Content addressable memory with error detection signaling

ABSTRACT

A content addressable memory (CAM) device having a data CAM array and an error CAM array. The data CAM array is provided to store data words, compare the data words with a comparand value, and, if one of the data words matches the comparand value, assert a match signal that corresponds to the matching data word. A priority encoder responds to the match signal by outputting a match address that corresponds to the matching data word. The error CAM array is provided to store at least one error address value and is coupled to the priority encoder to receive the match address. The error CAM array compares the match address with the error address value and asserts a match error signal if the match address matches the error address value.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a division of U.S. application Ser. No. 09/954,827,now U.S. Pat. No. 6,597,595, filed Sep. 18, 2001 which is acontinuation-in-part of U.S. patent application Ser. No. 09/922,423,filed Aug. 3, 2001. U.S. patent application Ser. No. 09/922,423 ishereby incorporated by reference in its entirety.

FIELD OF THE INVENTION

The present invention relates generally to content addressable memorydevices, and more particularly to error detection within contentaddressable memory devices.

BACKGROUND

Content addressable memory (CAM) devices are often used in networkswitching and routing applications to determine forwarding destinationsfor data packets. A CAM device can be instructed to compare a selectedportion of an incoming packet, typically a destination field within thepacket header, with data values, called CAM words, stored in anassociative storage array within the CAM device. If the destinationfield matches a CAM word, the CAM device records a CAM index thatidentifies the location of the matching CAM word within the storagearray, and asserts a match flag to signal the match. The CAM index isthen typically used to index another storage array, either within orseparate from the CAM device, to retrieve a destination address or otherrouting information for the packet.

Any corruption of CAM words stored within a CAM device (e.g., due toalpha particle bombardment or failure of a storage cell within the CAMdevice) may result in a false match/non-match determination andultimately in non-delivery of packets or delivery of packets to anincorrect destination. While it is known to store parity information inthe CAM device for error detection purposes, the parity information isgenerally used to detect errors only when a host device instructs theCAM device to perform a read operation (i.e., output a CAM word). Thatis, parity checking is not performed during a typical compare operationbecause the CAM word is usually not read during such an operation.Moreover, any interruption of the normal operation of the CAM device,for example to read CAM words for error detection purposes, reduces thenumber of timing cycles available for compare operations, effectivelylowering the compare bandwidth of the CAM device.

SUMMARY

A content addressable memory (CAM) device having a CAM storage array andcircuitry to detect errors in the CAM storage array is disclosed innumerous embodiments. In at least one embodiment, the CAM deviceincludes circuitry to identify errors in the CAM storage arrayconcurrently with performing host-requested compare operations, therebyproviding an error checking function without reducing the comparebandwidth of the CAM device. Further embodiments include circuitry tolog errors and error addresses in an error address register forsubsequent host inspection, and circuitry to automatically invalidate orcorrect an entry in the CAM storage array upon detecting an error. Also,embodiments that include an error CAM or other circuit for generating amatch error signal are also disclosed. These and other features andadvantages of the present invention are described in the detaileddescription below.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example, and not by wayof limitation, in the figures of the accompanying drawings and in whichlike reference numerals refer to similar elements and in which:

FIG. 1 illustrates a CAM device according to an embodiment of thepresent invention;

FIG. 2 illustrates an embodiment of the address circuit of FIG. 1 ingreater detail;

FIG. 3 illustrates a configuration register that may be included withinthe CAM device of FIG. 1;

FIG. 4 illustrates a clock circuit that may be used within the CAMdevice of FIG. 1;

FIG. 5 illustrates the structure of the CAM array of FIG. 1 in greaterdetail;

FIG. 6 is a block diagram of an error detector according to a paritychecking embodiment;

FIG. 7 illustrates an alternative embodiment of an error detector;

FIG. 8 illustrates a read/write circuit that includes parity generationcircuitry;

FIG. 9 illustrates the operation of an instruction decoder according toone embodiment;

FIG. 10 illustrates the CAM array, read/write circuit and error detectorof a CAM device having multiple, configurable storage blocks;

FIG. 11 illustrates an alternate error detector for use with a CAMdevice having multiple storage blocks;

FIG. 12 illustrates the structure of an exemplary configurable storageblock that may be used within the CAM array of FIG. 10;

FIG. 13 illustrates a circuit for generating a block parity errorsignal;

FIG. 14 is a block diagram of a CAM device capable of automaticallyinvalidating a CAM word upon detection of a parity error;

FIG. 15 illustrates an error detector that includes a multiple-entryerror address register to support self-invalidation;

FIG. 16 illustrates an alternative error detector 501 that operates onan error correction code instead of a parity bit;

FIG. 17 illustrates the operation of an instruction decoder in aself-invalidation operation;

FIG. 18 illustrates the operation of an instruction decoder in aself-correction operation;

FIG. 19 illustrates the increment operation within an address generatorused to generate a sequence of error check addresses;

FIG. 20 illustrates a system device 651 that includes a host processorand CAM device according to an embodiment of the invention;

FIG. 21 illustrates the operation of the host processor of FIG. 20according to one embodiment;

FIG. 22 illustrates a synchronous storage element which set by assertionof a parity error signal;

FIG. 23 illustrates use of the CAM device of FIG. 1 in an exemplarynetwork switching or routing application;

FIG. 24 illustrates a match error detector that may be included withinthe CAM device of FIG. 1 to generate a match error signal;

FIG. 25 illustrates a CAM device according to an embodiment thatincludes an error CAM to assert a match error signal if a match indexmatches any of a plurality of error addresses;

FIG. 26 illustrates an alternate embodiment of a CAM device thatincludes an error CAM;

FIG. 27 illustrates an embodiment of the error CAM of FIG. 25 in greaterdetail;

FIG. 28 illustrates the queue control circuit of FIG. 27 according toone embodiment;

FIG. 29 illustrates an embodiment of the flag logic circuit of FIG. 28;

FIG. 30 illustrates the CAM cell of FIG. 27 according to one embodiment;

FIG. 31 illustrates an embodiment of the multi-ported CAM cell 801 ofFIG. 30 in greater detail;

FIG. 32 illustrates a match disable transistor that may be coupled toeach match line within the error CAM array of FIG. 27 to prevent a matchsignal from being asserted on the match line while the corresponding rowof CAM cells is being loaded with an error address value;

FIG. 33 illustrates the use of a delay circuit to synchronize the outputof a match index and a match error signal; and

FIG. 34 is a timing diagram that illustrates the pipelining of data anderror compare operations.

DETAILED DESCRIPTION

CAM Device

FIG. 1 illustrates a CAM device 100 according to an embodiment of thepresent invention. The CAM device includes a CAM array 101, addresscircuit 103, instruction decoder 105, error detector 107, flag circuit112, priority encoder 114, comparand register 115 and read/write circuit161. Instructions, addresses and commands are input to the CAM devicevia an instruction bus (IBUS) 145, address bus (ABUS) 141 and comparandbus (CBUS) 143, respectively. Each of the buses is preferably amulti-conductor signal path coupled to at least one host device, such asa general purpose processor, digital signal processor, networkprocessor, application specific integrated circuit (ASIC) or otherinstruction issuing device. Also, in alternative embodiments, one ormore of the buses may be eliminated and the corresponding signalstime-multiplexed onto another of the buses.

The CAM array 101 includes a plurality of CAM cells arranged in rows forstoring CAM words. The CAM array also includes a validity storage 102 tostore validity values. Each validity value corresponds to a respectiverow of CAM cells and indicates whether the row contains a valid CAMword. As discussed below, each validity value may be represented by asingle bit or multiple bits. The CAM array 101 is coupled to (i.e.,connected directly to or through one or more intervening circuits) theaddress circuit 103, priority encoder 114, flag circuit 112, comparandregister 115, and read/write circuit 161. The address circuit 103 isused to select a particular row of the CAM array for read or writeaccess. The read/write circuit 161 is used to sense the output of theselected row during a read operation and to transmit a value to theselected row during a write operation. The comparand register 115 isused to store a comparand value received via the comparand bus 143, andoutputs the comparand value to the CAM array 101. In alternativeembodiments the comparand register 115 may be omitted and the comparandvalue input directly to the CAM array 101 from the comparand bus 143.During a compare operation, the comparand may be masked by a global maskvalue, then compared simultaneously with all the CAM words stored in theCAM array 101. Each of the rows of CAM cells is coupled to acorresponding match line 182, and any match between the comparand and avalid CAM word results in a match signal being output to the priorityencoder 114 and flag circuit 112 via the corresponding match line 182.When one or more match signals are asserted on the match lines 182, thepriority encoder 114 selects one of the match signals and outputs a CAMindex 174 (i.e., address of the CAM word corresponding to the selectedmatch signal). The flag circuit 112 also receives the match signals, andoutputs a match flag signal to indicate that a match has occurred. Ifmore than one match signal is asserted, the flag circuit mayadditionally output a multiple match flag signal to indicate thatmultiple matches have occurred.

As described below in greater detail, the CAM array 101 is preferablystructured to permit read and compare operations to be executedconcurrently (i.e., at least partly overlapping in time). Consequently,the CAM array may be read for error checking purposes even whenhost-requested compare operations are being performed. This providessignificant advantages over the prior art error checking techniquedescribed above because error checking can effectively be performed inthe background, with little or no consumption of compare bandwidth.Moreover, the prior art error checking occurs as part of ahost-requested read, meaning that only those CAM array locationsselected to be read by the host are error checked. Unless the host isprogrammed to systematically read all the locations in the CAM array, itis likely that numerous CAM array locations will not be checked. Bycontrast, in embodiments of the present invention, error checking isperformed systematically using an address generator within addresscircuit 103 to generate a predetermined sequence of error checkaddresses, thus ensuring that all locations within the CAM array arechecked.

Still referring to FIG. 1, the address circuit 103 is used to access theCAM array during read and write operations. Address values (received,for example, via the address bus 141 or from address sources within theCAM device) are decoded to activate corresponding word lines 181. Eachword line is coupled to a respective row of CAM cells within the CAMarray 101 and enables a CAM word to be output from or input to thearray. The instruction decoder 105 outputs a select signal 118 to selectthe address source used to access the CAM array 101. The instructiondecoder also outputs an enable signal 126 to the address circuit 103.The enable signal 126 is used to control generation of error checkaddresses by a check address generator within the address circuit 103.In one embodiment, the address circuit 103 outputs each check address tothe error detector 107.

All instructions to the CAM device, including instructions to load otherregisters are first received in the instruction decoder 105 via theinstruction bus 145. The instruction decoder 105 includes circuitry todecode the incoming instructions as well as control circuitry thatresponds to the decoded instructions by issuing control and timingsignals to other circuit blocks within the CAM device 100. In oneembodiment, the instruction decoder 105 is a state machine thattransitions from state to state in response to transitions of a clocksignal 104 (CLK) and according to status signals received from othercircuit blocks within the CAM device 100 and instructions received fromthe decode circuit 106. For another embodiment, the instruction decoder105 is a lookup table or read only memory (ROM). The instruction decoder105 may further include delay circuitry to delay output of timing andcontrol signals to other circuit blocks within the CAM device 100 untilappropriate times within a given cycle of the clock signal 104.

The error detector 107 is used to detect errors in CAM words output fromthe CAM array in error checking operations. The error detector 107 iscoupled to receive a CAM word and corresponding validity value from theread/write circuit 161 and to receive the control signals RESET 153 andREAD 151 from the instruction decoder 105. Upon detecting an error, theerror detector 107 outputs an error address 131 and asserts an errorflag signal 132. The error detector 107 receives the check address 155from the address circuit 103 for error logging purposes, and mayoptionally output an error address as indicated by dashed line 131. Inalternate embodiments, the reset signal 153 and/or read signal 151 maybe supplied by an external device (e.g., a host processor) instead ofthe instruction decoder 105.

FIG. 2 illustrates an embodiment of the address circuit 103 of FIG. 1 ingreater detail.

The address circuit 103 includes an address selector 125 that respondsto the select signal 118 from the instruction decoder (i.e., element 105of FIG. 1) by selecting an address 178 from one of a plurality ofaddress sources. An address decoder 127 decodes the selected address 178to activate one of a plurality of word lines 181. The address sourcesinclude one or more of a highest priority match (HPM) register 121, nextfree address (NFA) register 122, address bus 141, and check addressgenerator 124. Additional address sources (not shown) may also beprovided. The highest priority match (HPM) register 121 is loaded (e.g.,under control of the instruction decoder) with a CAM index 174 generatedduring a compare operation and therefore points to the CAM word thatproduced the highest priority match in the most recent compareoperation. The next free address register 122 is loaded with a CAM index174 that points to the address of an empty row of CAM cells within theCAM array (i.e., the “next free address”). In one embodiment, the nextfree address is determined during a write operation based on the stateof the validity values within the CAM array. The check address generator124 is used to generate a sequence of check addresses for error checkingpurposes. In the embodiment of FIG. 1, the check address generatoroutputs one check address at a time and advances to the next checkaddress in the sequence in response to the enable signal 126 from theinstruction decoder.

The check address 155 may alternatively be output from the check addressgenerator 124 or from the address selector 125. When the check addressis output by the address selector 125, any address source, including thecheck address generator, may be used to supply the check address to theerror detector (i.e., element 107 of FIG. 1). For example, ahost-requested read operation may be performed at an address suppliedvia the address bus 141 or at the address indicated by the HPM register121. In either case, error checking may be performed on the CAM wordread out of the CAM array, and the output of the address selector 125used to provide the check address to the error detector.

Although the HPM register 121, NFA register 122 and check addressgenerator 124 are all shown as being part of the address circuit 103,these circuit blocks may alternatively be disposed elsewhere in the CAMdevice. For example, in one embodiment, the HPM register is implementedby a field of bits (i.e., to contain the HPM address) within a statusregister of the CAM device. In such an embodiment, the status registermay be selected by the address selector to provide the HPM address for aCAM array access. Contents of the status register, including the HPMaddress, may also be output from the CAM device in a status readoperation.

Still referring to FIG. 2, the check address generator 124 may be loadedto start error checking from a particular address within the CAM array.Also, the check address generator may be started from a known state, forexample, upon device power-up or in response to a reset operation.

FIG. 3 illustrates a configuration register 109 that may be includedwithin the CAM device of FIG. 1 and used to provide configurationinformation to other circuit blocks within the CAM device. In oneembodiment, the configuration register 109 is loaded, in response to aload signal 175 from the instruction decoder, with one or moreconfiguration values received via the comparand bus 143. One or moreother signal paths may be used to provide configuration information inalternative embodiments. Connections between the configuration register109 and other circuit blocks within the CAM device are discussed belowin connection with descriptions of specific types of configurationinformation.

FIG. 4 illustrates a clock circuit 113 that may be used within the CAMdevice of FIG. 1 to generate the clock signal CLK 104 based on anexternally generated reference clock 147. The clock buffer 113 mayinclude circuitry, such as a phase locked loop or delay locked loop, toincrease or decrease the frequency of CLK 104 relative to the referenceclock 147 and to provide phase offsets as needed to time reception andtransmission of signals on the various buses coupled to the CAM device.For simplicity, FIG. 1 shows CLK 104 being supplied only to theinstruction decoder 105. In actual implementation, CLK 104 and timingsignals derived from CLK 104 may be provided to other circuit blockswithin the CAM device 100.

CAM Array

FIG. 5 illustrates the structure of the CAM array 101 in greater detail.A plurality of CAM cells 201 are arranged in rows and columns, with eachrow of CAM cells 201 being coupled to a respective word line 181 and toa respective match line 182. Each of the word lines 181 is coupled tothe address circuit 103 of FIG. 1, and each of the match lines 182 iscoupled to the priority encoder 114 and the flag circuit 112 of FIG. 1.Each of the CAM cells 201 in a given column is coupled to a pair of bitlines, BL 186 and BLB 187, and to a pair of comparand lines, CL 184 andCLB 185. Each CAM cell 201 preferably includes a memory cell to store atleast one binary bit of data, and a compare circuit to compare thecontent of the memory cell with a comparand signal and its complementpresented on the comparand lines CL 184 and CLB 185. Each CAM cell 201may further include a local mask cell to store a local mask value (sucha CAM cell is referred to as a ternary CAM cell). In one embodiment, thememory cell of each CAM cell 201 is a static storage element implementedby back-to-back coupled inverters. In alternative embodiments, differenttypes of storage cells may be used including, without limitation,dynamic storage elements (typically implemented by a single transistorand charge storage element), non-volatile storage elements or any othertype of storage element that can be used to store digital data. In thecase of a ternary CAM cell, the local mask cell may likewise beimplemented using back-to-back coupled inverters or any of the differenttypes of storage cells mentioned above.

During a compare operation, a respective portion of the comparand isapplied to each column of CAM cells 201 via lines CL/CLB such that thecomplete comparand is applied to each row of the CAM cells 201simultaneously. In one embodiment, each of the match lines 182 isprecharged to a high logical level at the start of a comparisonoperation, but pulled down to a low logical level by the compare circuitwithin any attached CAM cell 201 that receives comparand signals whichdo not match the stored data value. In this configuration, any matchline 182 not pulled low constitutes a match signal. The match lines 182are coupled to the flag circuit 112 of FIG. 1 which determines whetherany match signals are asserted and, if so, asserts the match flag signal176. The flag circuit may also assert a multiple match flag signal ifmore than one match signal is asserted. The match lines 182 are alsocoupled to the priority encoder 114 of FIG. 1 which determines thehighest priority match signal according to a predeterminedprioritization policy and outputs an index (i.e., a CAM index) thatcorresponds to the CAM array location that produced the match signal.

During a read or write access to the CAM array 101, an address of CAMcells to be accessed is supplied to the address decoder 127 of FIG. 2.The address decoder 127 decodes the address to activate the word line181 that corresponds to the selected row of CAM cells. The activatedword line effectively couples the memory cells of the selected row ofCAM cells to the bit lines BL/BLB (e.g., by way of pass gates coupledbetween the memory cells and the bit lines), thereby enabling data to beread out of or written into the selected row. In a write operation, asignal driving circuit (not shown in FIG. 5) within the read/writecircuit 161 of FIG. 1 is enabled by the instruction decoder to drive aCAM word or local mask word onto the bit lines BL/BLB (additional bitlines, not shown in FIG. 5, may alternatively be provided to access thelocal mask cells to store or read a local mask word). The signalspresent on the bit lines are then latched or otherwise stored in thememory cells in the selected row of CAM cells. During a read operation,the contents of the memory cells (or local mask cells) of the selectedrow are enabled onto the bit lines BL/BLB where they are sensed by abank of sense amplifiers 162 within the read/write circuit.

Reflecting on the structure of CAM array 101, it can be seen thatproviding separate signal paths to the CAM cells 201 for comparand anddata values enables data to be output from the CAM array 101concurrently with a comparand being input into the CAM array 101 forcomparison purposes. By this arrangement, a CAM word (or local maskword) may be read from the CAM array for error checking purposesconcurrently with performance of a compare operation. As mentioned, thisconcurrency of comparison and error checking operations providessignificant advantages over the prior art technique described above,including the ability to do systematic background error checking withlittle or no reduction in compare bandwidth.

Still referring to FIG. 5, the CAM array 101 also includes validitystorage cells 202 which form the validity storage discussed above inreference to FIG. 1. In one embodiment, the validity storage cells aresimilar to the CAM cells 201, but include additional circuitry toinitialize the validity values to a predetermined state at devicepower-up. For example, in the case of validity storage cells 202 havingvolatile memory cells, the validity storage cells 202 preferably includecircuitry to force the validity value within each validity storage cell202 to a reset state in response to a reset signal asserted on line 171,thus indicating that none of the rows of CAM cells 201 include valid CAMwords. Thereafter, as CAM words are written to selected rows of CAMcells 201, the validity values within the corresponding validity storagecells 202 are set to indicate storage of valid CAM words.

In one embodiment, each validity value is represented by a single binarybit, called a validity bit. In a first state (i.e., when set), thevalidity bit indicates that the corresponding row of CAM cells containsa valid CAM word. Conversely, in a second state (i.e., when reset), thevalidity bit indicates that the corresponding row of CAM cells does notcontain a valid CAM word. In alternative embodiments, two or more bitsmay be used to represent the validity value. For example, in onealternative embodiment, the validity value is formed by a pair of bits:a skip bit and an empty bit. The skip bit indicates that thecorresponding row of CAM cells are to be skipped (i.e., ignored) duringa compare operation, while the empty bit indicates that no CAM word isstored in the corresponding row of CAM cells. Thus, the skip bit and theempty bit are each reset to indicate that a valid CAM word is stored inthe corresponding row of CAM cells. In the interest of clarity, thevalidity value is described as a validity bit in the remainder of thepresent description. However, any number of bits may be used to form thevalidity value in alternative embodiments.

During a compare operation, the validity bits are used to prevent matchsignal assertion for those rows of CAM cells which do not contain validCAM words. For example, in the embodiment described above in which thematch line is pulled low to signal a mismatch, each reset validity bitprevents assertion of a match signal by pulling the match line low forthe corresponding row of CAM cells. Consequently, no match is signaledfor rows having reset validity bits regardless of whether the rowcontents match the comparand. During a read operation, the validity bitis sensed (i.e., via lines 193 and 194) along with the CAM word andforward to the error detector 107 where it is used to prevent assertionof the error signal 132 and logging of an error address 131 for invalidCAM words.

Error Detector

FIG. 6 is a block diagram of the error detector 107 of FIG. 1 accordingto a parity checking embodiment. As shown, a CAM word formed by of Ngroups of M data bits is output from the sense amplifier bank 162. Thefirst group of data bits is designated D[M−1, 0], the second group ofdata bits is designated D[(2×M)−1, M] and so forth to the final group ofdata bits designated D[(N×M)−1, (N−1)×M]. The CAM word also includes Nparity bits, one for each group of M bits. Although N parity bits aredepicted in FIG. 6, any number of parity bits per CAM word may be usedin alternative embodiments. For example, a single parity bit may be usedfor the entire CAM word.

The data and parity bits are input to a parity check circuit 201 thatincludes a separate parity generator 206 and compare circuit 208 foreach group of data bits and its corresponding parity bit. Each paritygenerator 206 generates a binary output according to the state of aneven/odd select signal 232 and the number of set (or reset) data bitswithin the corresponding group of data bits. For example if the even/oddselect signal 232 selects odd parity, circuitry within the paritygenerator 206 will output a logic ‘1’ if the input group of data bitscontains an odd number of logic ‘1’ data bits, and a logic ‘0’ if thegroup of data hits contains an even number of logic ‘1’ data bits. Ifthe even/odd select signal 232 selects even parity, the output of theparity generator 206 is inverted, i.e., outputting ‘1’ if the inputgroup of data bits contains an even number of logic ‘1’ data bits and alogic ‘0’ if the group of data bits contains an odd number of logic ‘1’data bits. In alternative embodiments, the logic states may be invertedso that the parity generator 206 outputs a logic ‘0’ if the number oflogic ‘0’ data bits is odd or even (in the case of odd parity selectionor even parity selection, respectively). Also, the output of the paritygenerator 206 may be inverted so that, if odd or even parity isselected, the total number of bits in the logic ‘1’ state, including thebit output by the parity generator, is always odd or even, respectively.

The parity generator 206 is preferably formed using conventionalcombinatorial circuitry, for example a combination of exclusive ORgates, to produce a parity result shortly after a CAM word is loadedinto the row buffer 162. The even/odd select signal 232 may be outputfrom a configuration register (e.g., element 109 of FIG. 3) according toa configuration value programmed by the host processor. In oneembodiment, the parity bits stored in the CAM array are generated bycircuitry external to the CAM device (e.g., the host processor), thenwritten to the CAM array along with the corresponding CAM word.Accordingly, such parity bits may be selected to produce either odd oreven parity according to the configuration of the external parity bitgenerator. In that case the even/odd select signal 232 may be programmedby the host to match the parity configuration of the external parity bitgenerator. In an alternative embodiment, shown in FIG. 8, paritygeneration circuitry 306 within the read/write circuit 161 (element 161of FIG. 1) may be coupled to the write data path 302 and used togenerate one or more parity bits. The write data and correspondingparity bits are then written into the CAM array by driver circuit 307during a CAM write operation. The even/odd select signal 232 may beinput to the parity generation circuitry 306 or, alternatively, theeven/odd select signal 232 may be omitted altogether (i.e., omitted fromread/write circuit 161 and error detector 107 of FIG. 6) and theeven/odd selection may be hardwired for either even or odd paritygeneration. In alternative embodiments, parity functions other than evenand odd parity may be used.

Returning to FIG. 6, the compare circuit 208 compares the output of theparity generator 206 with the corresponding stored parity bit. Comparecircuit 208 is preferably a combinatorial logic circuit such as an XORcircuit that outputs a logic ‘1’ only if the stored parity bit and theparity bit generated by the parity generator 206 do not match, but mayalternatively be any type of circuit for detecting mismatch between thestored and generated parity bits. The outputs of all the comparecircuits 208 are logically ORed in gate 221 so that, if any one of thecompare circuits 208 signals a mismatch (i.e., a logical ‘1’), theparity check circuit 201 will output a logical ‘1’. For embodiments inwhich a single parity bit is used for an entire CAM word, OR gate 221may be omitted. As shown in FIG. 6, the output of the parity checkcircuit 201 is gated by the validity bit for the CAM word in AND gate222 to generate a parity error signal 231. That is, even if a paritymismatch is signaled by the parity check circuit 201, the parity errorsignal 231 will not be asserted by AND gate 222 unless the validity bitfor the CAM word being error checked indicates that the CAM word isvalid. By this arrangement, parity errors are signaled only for validCAM words.

The parity error signal 231 is supplied to the set input of an S-Rflip-flop and to the load input of an error address register 203. Thecheck address 155 from the check address generator (element 124 of FIG.2), which constitutes a parity address in this example, is also input tothe error address register 203 so that, if the parity error signal 231is asserted, the parity address is loaded into the error addressregister 203. As shown in FIG. 6, CLK 104 is input to the error addressregister 203 to initiate the load operation, but another timing signalmay be used to initiate the load operation in an alternative embodiment.As described below, the error address register 203 may be designed tostore only a single error address (i.e., address of a location withinthe CAM array that produced a parity error), or the error addressregister 203 may be designed to store multiple error address entries. Ineither case, one entry within the error address register is preferablyused to produce the error address signal 131. In the case of amultiple-entry error address register, the read signal 151 may be usedto advance the entries in the error address register 203. In the case ofa single-entry error address register, the read signal may be omitted.

Still referring to FIG. 6, the S-R flip-flop 224, when set, drives theerror flag signal 132. As described above, the error flag signal 132 ispreferably output directly to a host device to signal the errorcondition, but may alternatively (or additionally) be output as part ofa status word during a host-requested status read operation. The resetsignal 153 is received from the instruction decoder as shown in FIG. 1and is used to clear the error flag signal by resetting the S-Rflip-flop 224.

In alternative embodiments, storage elements other than an S-R flip-flopmay be used to register the error condition. For example, FIG. 22illustrates a synchronous storage element 261 which is set by assertionof the parity error signal 231 during a CLK transition. The output ofthe synchronous storage element 261, i.e., the error flag signal 132, islogically ORed with the parity error signal 231 in gate 258 so that theerror flag signal 132 remains asserted after the parity error signal 231is deasserted. In one embodiment, the output of the OR gate 258 is ANDedwith an active low version of the reset signal 154 in gate 260 beforereaching the input of the synchronous storage element. By thisarrangement, the error flag signal 132 is reset at any CLK transition inwhich the active low reset signal 154 is asserted. In an alternativeembodiment, the AND gate 260 may be omitted and the reset signal 153applied to a dedicated reset input of the synchronous storage element261. This alternative embodiment is depicted by the dashed arrow 255.

FIG. 7 illustrates an alternative embodiment of an error detector 287 inwhich a multiple-entry error address register 289 is provided and inwhich a separate error flag value (E₀-E_(X−1)) is stored along with eacherror address in the error address register. The multiple-entry erroraddress register 289 preferably operates as a first-in-first-out (FIFO)storage having head and tail entries. The error flag value for the headentry in the FIFO (i.e., E₀) is used to produce the error flag signal132 and the error address value stored in the head entry (i.e., EADDR₀)is used to drive the error address signal 131. Accordingly, if the headentry in the FIFO contains an error entry (i.e., error flag value E₀ isset), the error flag signal 132 will be asserted and the address of theCAM word containing the error will be present on the error addressoutput 131. Conversely, if the head entry in the FIFO does not containan error entry (E₀ is not set), the error flag signal 132 will not beasserted.

Still referring to FIG. 7, the parity check circuit 201 and logic gate222 function as described in reference to FIG. 6 to generate a parityerror signal 231 if the CAM word under test contains an error and isindicated to be valid by the corresponding validity bit. As shown, theparity error signal 231 is used to signal the error address register 289to load the check address 155 into a register entry and to set the errorflag for the entry. The error address register load operation may betimed by the CLK signal 104 as shown, or by another timing signal.

The read signal 151 is asserted during an error address read operationto advance the contents of the error address register 289. Morespecifically, when the read signal 151 is asserted, the contents of theerror address register 289 are shifted forward so that the entrydepicted in FIG. 7 as EADDR₁/E₁ becomes the head entry EADDR₀/E₀, entryEADDR₂/E₂ becomes EADDR₁/E1 and so forth. This entry shifting may beaccomplished either by actual shifting of contents from one entry to thenext or by shifting of pointers that indicate the head and tail entrieswithin the error address register 289. In the content shiftingembodiment, the error flag value for the former tail entry is clearedwhen the shift is complete to indicate that the entry is free to receivea new error address. In the case of pointer shifting, the error flagvalue for the former head entry is cleared to indicate that the entrydoes not contain a valid error address.

The error address register 289 is depicted as having X entries (0 toX−1) available for error address storage. If all X entries of the erroraddress register are filled with valid error addresses, a full signal,EA FULL 291, may be asserted to indicate the full condition. The fullsignal 291 is preferably provided to the instruction decoder (element105 of FIG. 1) to stall further error checking until one or more erroraddress read operations are performed to free entries in the erroraddress register 289. The full signal 291 may also be output from theCAM device (e.g., directly or in response to a status read) to signalthe full condition to the host processor or other entities external tothe CAM device.

Instruction Decoder Operation—Concurrent Instruction Execution andParity Check

FIG. 9 illustrates the operation of an instruction decoder (e.g.,element 105 of FIG. 1) to control background error checking according toone embodiment. Initially, in block 309, the instruction decoder selectsthe check address generator to be the address source for a read accessto the CAM array. At block 310, the instruction decoder starts an errorcheck timer. In one embodiment, the timer is a counter that counts up ordown from an initial value (the reset value) until a predeterminedterminal count value is reached, the difference between the initialvalue and the terminal count corresponding to the time required tocomplete an error checking operation on the CAM array. During the errorcheck operation, the instruction decoder monitors incoming instructionsin decision block 311 to determine whether a host processor hasrequested read or write access to the CAM array . If so, the instructiondecoder resets the error check timer in to the initial value in block312, then issues the appropriate signals to perform the host requestedaccess in block 313. A predetermined time later (according to the amountof time required to complete the host requested operation), theinstruction decoder restarts the error check operation at block 309.

The instruction decoder continues to monitor incoming instructions indecision block 311 until the error check timer has reached the terminalcount value (as determined at decision block 314). After the error checktimer has reached the terminal count, the instruction decoder signalsthe check address generator to increment the check address (block 315)and resets the error check timer at block 316, before beginning anothererror check operation at block 310.

In an alternative embodiment, the error flag signal is provided to theinstruction decoder, which selectively enables the check addressgenerator to increment the check address according to whether a parityerror is detected. Accordingly, if the error flag signal is determinedto be set after decision block 314, the error check operation iscompleted without signaling the check address generator to increment thecheck address and further error checking is halted until remedial actionis taken (e.g., self-invalidation or self-correction, discussed below,or action by the host). Alternatively, if the error detector includes amultiple-entry error address register, the instruction decoder maysignal the check address generator to increment the check addressdespite error flag signal assertion so long as the error addressregister is not full. In such an embodiment, a full signal may be outputby the error address register to notify the instruction decoder when theerror address register is full (i.e., when all entries of the erroraddress register have been loaded with error addresses).

In the embodiment illustrated by FIG. 9, the instruction decoder doesnot disable the check address generator from incrementing the checkaddress except in response to a host instruction. The host processormay, for example, detect assertion of the error flag signal and issue aninstruction to the CAM device to halt further testing until the hostprocessor takes remedial action (e.g., restores a valid CAM word to theCAM array location indicated by the error address).

As mentioned above in reference to FIG. 2, error checking may beperformed not only on CAM words selected by the check address generator,but on any CAM word read from the CAM array. For example, performing thehost requested access in block 313 may involve reading a CAM word fromthe array at a host-supplied address (or other address source such asthe HPM register), then error checking the CAM word in the mannerdescribed above. As discussed in reference to FIG. 2, the check addressmay be selected by the address selector 125 so that a proper checkaddress may be stored by the error detector regardless of the addresssource.

Configurable Multi-Block CAM Device

FIG. 10 illustrates the CAM array 321, read/write circuit 322 and errordetector 323 of a CAM device having multiple, configurable storageblocks 325. In the embodiment of FIG. 10, each of the storage blocks325, designated 1 through K, is coupled to the read/write circuit 322and has a storage width and depth according to a configuration signal,CONFIG 327. In alternative embodiments, the storage width and depth ofone or more (or all) of the storage blocks may be fixed and theconfiguration signal 327 omitted.

Sense amplifier circuitry within the read/write circuit 322 is used tosense a CAM word output from the CAM array 321 during an error checkoperation as described in reference to FIG. 5. As described below, errorcheck operations may be performed on each of the storage blocks 325 insequence or concurrently on all the storage blocks 325. In either case,the data, parity and validity values (referred to collectively as a“DPV” value) for the output CAM word is forwarded to an error detectioncircuit 329 that corresponds to the block containing the CAM word. Eachof the error detection circuits, in turn, outputs a parity error signalfor its respective block, referred to as a block parity error signal330. The block parity error signals 330 from the error detectioncircuits 329 are logically ORed in gate 331 to produce a global parityerror signal 335. The global parity error signal 335 is coupled to theload input of the error address register 337 and the set input of theS-R flip flop 339. Accordingly, when a parity error is signaled by anyof the error detection circuits 329, the resulting global parity errorsignal is used to load the check address 155 (e.g., from the checkaddress generator) into the error address register 337 and is used toset S-R flip-flop 339. The error address register 337 and S-R flip flop339 output the error address 131 and error flag signal 132,respectively, and respond to the read signal 151, CLK 104 and resetsignal 153 as described above in reference to FIGS. 3 and 4. Asdiscussed, other circuits may be used to register or latch the errorflag signal. Also, the error address register may be a single ormulti-entry register and may be implemented according to any of thedifferent embodiments described in reference to FIGS. 3 and 4.

For embodiments that concurrently perform error checking on CAM wordsfrom each of the different storage blocks, error detector 323 mayinclude additional circuitry (not shown) to store a value indicative ofwhich of the error detection circuits 329 has signaled a block error330. This value, referred to as a block identifier, is preferably storedalong with the check address 155 within the error address register 337.The block identifier may then be output from the error address register337 as part of the error address to enable a host or other circuitrywithin the CAM device to identify the block or blocks within the CAMarray 327 that produced the error indication.

Although error detector 323 may be used to simultaneously error check arespective CAM word from each of the blocks, the provision of separateerror detection circuits for each storage block increases the transistorcount and complexity of the error detector implementation. Inembodiments of the multiple storage block CAM device that error checkone CAM word at a time, the multiple error detection circuits 329 may beomitted in favor of a single error detection circuit that is selectivelycoupled to the output of each of the storage blocks 325. An errordetector 348 having such an alternative arrangement is illustrated inFIG. 11. The DPV values from each of the K storage blocks are coupled torespective inputs of a multiplexer 349. Block address bits from within(or derived from) the check address 155 are supplied to a select inputof the multiplexer 349 to select the DPV value from the storage blockbeing error checked. The error detection circuit 350 then generates aerror signal 357 in the manner described above, the error signal 357being used to set the error flag signal 132 (i.e., in S-R flip flop 352or other storage circuit) and also to signal the error address register354 to load the check address 155 at the next CLK 104 transition. Theread and reset signals (151, 153) operate as described above to advancethe entries within the error address register and reset the error flagsignal, respectively. Also, the error address register 354 may be asingle or multi-entry register and may be implemented according to anyof the different embodiments described above.

Configurable Storage Block

FIG. 12 illustrates the structure of an exemplary configurable storageblock 381 that may be used within the CAM array of FIG. 10. As shown,the storage block 381 is organized in four segments (0 to 3, althoughmore or fewer segments may be used) with each segment including N rowsof CAM cells (0 to N−1), a parity value and a valid value. As with theCAM cells in embodiments described above, each CAM cell may have anytype of storage cell, and may be a ternary CAM cell. The contents of theCAM cells are designated “DATA” in FIG. 12 and may include CAM words andlocal mask words.

A configuration signal (not shown), for example from configurationregister 109 of FIG. 3, is used to determine how the segments areaccessed in a host requested read or write operations and, therefore,how CAM words (and local mask values) are stored in the storage block381. For example, in a first configuration, each segment is used tostore N distinct 72-bit CAM words so that the storage dimension of thestorage block 381 is 4N×72 bits. This configuration is referred to as a“by one” configuration (×1) to indicate that the CAM word is one segmentwide. In a ×2 configuration, each pair of segments (i.e., segment pair0, 1 and segment pair 2,3) is used to store 144-bit CAM words so thatthe storage block 381 has a storage dimension of 2N×144 bits. In ×4configuration, all four segments are used to store 288-bit CAM words sothat the storage block 381 has a storage dimension of N×288 bits. Itwill be appreciated that more or fewer than 72 bits per segment may beprovided in alternative embodiments and that numerous otherconfigurations may be achieved in storage blocks having additionalsegments or different distributions of validity values within thestorage block. Also, while a single parity bit per segment is shown inFIG. 12, any number of parity bits may be provided per segment inalternative embodiments (e.g., as shown in FIG. 6).

In the embodiment of FIG. 12, parity checking is performed one segmentafter another for each segment within the storage block 381, regardlessof storage dimension configuration. In such an embodiment, the checkaddress generator 383 preferably generates a check address having threecomponents: a block address component 391 to select the storage block tobe parity checked, a segment address component 393 to select the segmentto be parity checked within the selected storage block, and a rowaddress component 395 to select a row within the selected segment of theselected bock (note that the check address may be a single value, withthe block, segment and row address components being represented byselected bits within the check address). The segment address component393 of the check address is input to the multiplexer 382 to select theappropriate DPV value from the storage block 381. The data and parityvalues are supplied to a parity check circuit 396 to determine whetherthere is a parity mismatch. The output of the parity check circuit 396is gated by the validity bit in AND gate 398 to produce a block parityerror signal 401. The block parity error signal 401 may then belogically ORed with block parity error signals from other blocks toproduce a global parity error signal as shown in FIG. 10. Also, thoughnot shown in FIG. 12, the multiplexer 382 may be extended (or a secondmultiplexer provided) to allow selection of a DPV value from a selectedsegment (indicated by the segment address component of the parityaddress) from a selected block (indicated by the block address componentof the parity address) for input to a single error detection circuit asshown in FIG. 11.

FIG. 13 illustrates a circuit for generating a block parity error signal427 through concurrent parity checking of complete CAM words regardlessof whether the storage block 381 is configured to store a ×1, ×2 or ×4CAM word. As shown, four distinct parity check circuits 405 are coupledrespectively to receive the data and parity values from the foursegments of the storage block 381 (more or fewer parity check circuits405 may be provided according to the number of storage block segments).The output of each parity check circuit is ANDed in a respective logicgate 407 with the validity bit from the corresponding segment to producea segment parity error signal 409. The four segment parity error signals409 are input individually and in logical combinations with one anotherto multiplexer 421 The logical combinations include: (1) ORing thesegment 3 parity error signal with the segment 2 parity error signal inOR gate 411 to produce a ×2 parity error signal indicative of whether a×2 CAM word spanning segments 2 and 3 has a parity error; 2) ORing thesegment 1 parity error signal with the segment 0 parity error signal inOR gate 412 to produce a ×2 parity error signal indicative of whether a×2 CAM word spanning segments 0 and 1 has a parity error; and 3) ORingall the segment parity error signals in OR gate 413 to produce a ×4parity error signal indicative of whether a CAM word spanning all foursegments has a parity error. Additional combinations of segment parityerror signals 409 may be provided in alternative embodiments.

Still referring to FIG. 13, the multiplexer 427 is responsive to aconfiguration signal 423 (e.g., from the configuration register 109 ofFIG.3), and a segment address 425 (e.g., from the check addressgenerator) to select one of the individual segment parity error signals409 or one of the logical combinations of segment parity error signals(i.e., ×2 or ×4 parity error signals) to drive the block parity errorsignal 427. For example, if the configuration signal 423 indicates a ×1configuration, then the segment address 425 is used to select one of thefour segment parity error signals 409 to drive the block parity errorsignal 427. If the configuration signal 423 indicates a ×2configuration, then the segment address 425 is used to select betweenthe two ×2 parity error signals output from OR gates 411 and 412 todrive the block parity error signal 427. If the configuration signal 423indicates a ×4 configuration, the ×4 parity error signal output from ORgate 413 is selected to drive the block parity error signal 427.

The circuit of FIG. 13 may be modified such that, for the ×2 and ×4parity error signals, the outputs of the participating parity checkcircuits 405 are first logically ORed with one another and then ANDedwith a logical OR combination of corresponding validity bits. By thisarrangement, only one of the two validity bits for a ×2 CAM word needsto be set to perform a complete parity check of the CAM word. A similarlogical OR combination of all four parity check circuit outputs may beANDed with a logical OR combination of all four validity bits to producethe ×4 parity error signal. The Boolean expressions for such anarrangement are as follows

×2 (S 0+S 1)=(PCC 0+PCC 1)*(V 0+V 1)

×2 (S 2+S 3)=(PCC 2+PCC 3)*(V 2+V 3)

×4=(PCC 0+PCC 1+PCC 2+PCC 3)*(V 0+V 1+V 2+V 3),

where the ‘+’ symbol represents a logical OR operation, the ‘*’ symbolrepresents a logical AND operation, V signifies a validity bit and PCCsignifies a parity check circuit output.

The circuit of FIG. 13 may alternatively be modified to require that allthe validity bits for a given ×2 or ×4 CAM word be set in order for anerror to be signaled. The Boolean expressions for such an arrangementare as follows:

×2 (S 0+S 1)=(PCC 0+PCC 1)*V 0*V 1

×2 (S 2+S 3)=(PCC 2+PCC 3)*V 2*V 3

×4=(PCC 0+PCC 1+PCC 2+PCC 3)*V 0*V 1*V 2*V 3

Other logical constructs for generating ×2 and ×4 parity error signalsmay be used without departing from the scope of the present invention.Also, numerous additional logical constructs may be used to generatemulti-segment parity error signals for a storage block having additionalsegments or different distributions of validity bits within the storageblock.

Still referring to FIG. 13, in an alternative embodiment a row of CAMcells spanning all four segments of the CAM block 381 may beconcurrently error checked without regard to the width and depthconfiguration of the block. In such an embodiment, the multiplexer 421and logic gates 411 and 412 may be omitted, and the OR gate 413 used togenerate the block parity error.

CAM Device with Self-Invalidating Function

FIG. 14 is a block diagram of a CAM device 441 capable of automaticallyinvalidating a CAM word upon detection of an error. The CAM device 441,referred to as a self-invalidating CAM, includes an instruction decoder443, check address generator 445, address selector 447, address decoder449, CAM array 450, read write circuit 453 and error detector 455.Numerous other circuit blocks may be included in the CAM device 441,including circuit blocks shown in the CAM device of FIG. 1, but havebeen omitted from FIG. 14 in the interest of clarity. The instructiondecoder 443, check address generator 445, address selector 447, addressdecoder 449, CAM array 450, read/write circuit 453 and error detector455 operate generally in the manner described in reference to thepreceding figures (e.g., instruction decoder 105 of FIG. 1; checkaddress generator 124 of FIG. 2; address selector 125 of FIG. 2; addressdecoder 127 of FIG. 2; CAM array 101 of FIGS. 1 and 5; read/writecircuit 161 of FIGS. 1 and 8, and read/write circuit 322 of FIG. 10; anderror detector 107 of FIGS. 1, 5, and 6, error detector 287 of FIG. 7,error detector 323 of FIG. 10, and error detector 348 of FIG. 11). Morespecifically, if the error detection circuit 456 detects a parity errorin the CAM word selected for error checking by the check addressgenerator 445, the error flag signal 132 is asserted (e.g., by S-R flipflop 457 or other storage element) and the error address register 458 isloaded with the check address 155. The entries within the error addressregister 458 are advanced in response to a read signal 151 from theinstruction decoder 443 and the error flag signal is deasserted inresponse to a reset signal 153 from the instruction decoder 443.

As shown, the instruction decoder 443 is coupled to the output of theS-R flip flop 457 and therefore is signaled upon detection of a parityerror. If no parity error is signaled, the instruction decoder 443issues an increment signal 444 to the check address generator 445 whichresponds by incrementing a counter 446 containing the parity address. Ifa parity error is signaled, the instruction decoder 443 does not issuethe increment signal 444 to the check address generator 445 and theaddress counter 446 remains pointed at the CAM word which produced theparity error.

FIG. 17 illustrates the operation of the instruction decoder 443 (FIG.14) in a self-invalidation operation. Starting at decision block 475,the instruction decoder monitors the reception of instructions via theIBUS to determine if any no-operation (no-op) instructions are receivedor if any idle intervals (i.e., no instruction transmission by the host)occur. If instructions requiring read, write or compare operations onthe CAM array are received, the instructions are executed as indicatedby block 477. On the other hand, if a no-op instruction (or idleinterval) is detected at decision block 475, the instruction decoderevaluates the error flag signal at block 479 to determine if the errordetector has detected an error in the CAM array. If the error flag isnot set, the instruction decoder returns to monitoring the incominginstructions for no-ops and idle intervals. If the error flag is set,then at block 481 the instruction decoder signals the address selectorto select the check address generator as the address source for a CAMarray access. At block 483 the instruction decoder signals the writecircuit to clear the validity bit for the CAM word selected by theaddress decoder, thereby invalidating the CAM word. The validity bit maybe cleared, for example, by a write to the selected CAM word (includingthe validity bit), or by signaling the validity storage within the CAMarray to reset the validity bit for the selected CAM word. Once thevalidity bit for the CAM word is reset, the CAM word may no longerproduce a match result during a compare operation. Accordingly, byperforming the self-invalidation operation, false matches due to thecorrupted CAM word may be prevented.

Depending on the amount of time required to perform theself-invalidation operation, it may be desirable for the instructiondecoder to issue a busy signal (illustrated in FIG. 14 by dashed line447) to the host processor during a self-invalidation operation toprevent the host processor from issuing instructions that will result ina resource conflict within the CAM device 441 (e.g., host instructionsthat require read, write or compare operations to be performed on theCAM array). Alternatively, a self-invalidation operation may be abortedto perform a host requested operation in the event of a resourceconflict.

Although a self-invalidation operation has been described, theinstruction decoder 443 of FIG. 14 may also invalidate a corrupted CAMword in response to an explicit host instruction. In that case, thesequence of operations may similar to those shown in FIG. 17 (i.e.,blocks 481 and 483) followed by a signal to the error detector 455 toreset the error flag 132.

Still referring to FIG. 14, if the error address register 458 is amultiple-entry error address register, it may be desirable to access theCAM array (in a self-invalidation operation) using the error address 131instead of the check address 155. A signal path for this purpose isshown by dashed line 452 in FIG. 14. In this alternative configuration,the error address register may be advanced (e.g., by issuance of readsignal 151) after each self-invalidation operation to step through theerror addresses logged in the error address register 458. Accordingly,the CAM word for each entry in the error address register 458 may beinvalidated in a separate invalidation operation until the error addressregister is emptied.

FIG. 15 illustrates an error detector 460 that includes a multiple-entryerror address register to support self-invalidation. The error detectoris similar to the error detector 455 in FIG. 14, except that, inresponse to a load signal from the error detection circuit 465, an errorflag is stored in the error register 462 along with the correspondingcheck address 155. The error flags are designated E₀ to E_(X−1) in FIG.15. As the entries in the error address register 462 are advanced (e.g.,in response to read signal 151) the error flag associated with the newhead entry in the error address register 462 is used to provide theerror flag signal 132, and the error address at the head entry is usedto provide the error address output 131. By this arrangement, theinstruction decoder may step through the error address register entriesin a sequence of self-invalidation operations until an entry having areset error flag is reached, signifying that the error address register462 has been emptied.

In many CAM applications, a backup storage of the CAM array content ismaintained to allow the CAM array to be restored in the event of memoryloss or corruption. In such applications, self-invalidation of a CAMword may result in loss of coherency (i.e., sameness) between the CAMarray and the backup storage. Accordingly, it may be desirable toprovide an alternate error storage within a CAM device so that, as theCAM device performs self-invalidation operations to clear errors in theerror address register, those same errors remain logged in the alternateerror storage. The host may then access the alternate error storage fromtime to time to determine whether errors have occurred and, if so, takeappropriate actions to maintain coherency between the CAM array and thebackup storage, and restore any invalidated CAM words. In oneembodiment, the alternate storage is substantially identical to theerror address register (and loaded at the same time) except that aself-invalidate indicator is included in each entry. The self-invalidateindicator is initially reset when an error is logged, but then set if aninvalidate operation takes place at the logged error address. In analternate embodiment, no such self-invalidate indicator is maintained.

Error Correction Code—CAM Device with Self-Correcting Function

Thus far, error checking has been described primarily in terms of paritychecking. FIG. 16 illustrates an alternative error detector 501 thatoperates on an error correction code stored with the CAM word instead ofa parity bit. Error correction codes (e.g., Hamming codes) are sequencesof bits formed, for example, by generating parity values for overlappinggroups of bits within the CAM word. The chief advantage of errorcorrection codes (ECCs) is that they permit location and thereforecorrection of a single bit error within a data value. ECCs also permitdetection of two-bit errors within a data value; errors that typicallywill not be detected by a parity-checking scheme because the two errorscancel one another insofar as they contribute to the even/odd parity ofthe data value.

As shown in FIG. 16, a CAM word 503 and corresponding ECC 505, whichtogether form a codeword, are supplied to a circuit called a syndromegenerator 507. The syndrome generator 507 effectively multiplies thecodeword with a parity check matrix (e.g., a Hamming matrix) to generatea parity check vector called a syndrome 508. In one embodiment, anynonzero bit in the syndrome 508 indicates that an error has occurred.Accordingly, the individual bits of the syndrome 508 are logically ORedin gate 511 to determine if the CAM word 503 has an error. The output ofOR gate 511 is then gated by the validity bit 506 for the CAM word 503in AND gate 513 to generate an error signal 514. The error signal 514 isapplied to the load input of an error address register 517 to cause theerror address register 517 to be loaded with an error address 536 at thenext transition of CLK 104. An ECC address generator 535 is used toaddress the CAM array for error detection purposes and also to supplythe error address 536 to the error address register 517.

The syndrome 508 is additionally supplied to an error correction circuit509 along with the CAM word 503. If the syndrome is nonzero (indicatingan error), and a single bit error has occurred, the error correctioncircuit 509 generates a corrected CAM word 510. In one embodiment, thecorrected CAM word 510 is generated by identifying a column of bits inthe parity check matrix that matches the bit pattern of the syndrome508. The position of the matching column within the parity check matrix(i.e., first column, second column, etc.) corresponds to the position ofthe bit in error within the CAM word 503. The bit in error is thenflipped (i.e., inverted) by the error correction circuit 509 to producethe corrected CAM word 510. As shown in FIG. 16, the corrected CAM word510 is supplied to the error address register 517 for storage in acorrected data array (CDATA).

If the syndrome 508 does not match one of the columns of the paritycheck matrix corresponding to a single bit error, a multi-bit error hasoccurred and CAM word output from the error correction circuit 509 isnot a corrected CAM word. Accordingly, a signal to indicate whether theCAM word 503 has been corrected, called a C bit 512, is output from theerror correction circuit 509 along with the CAM word 510. If asingle-bit error has been detected and corrected, the C bit 512 is setto indicate that the CAM word 510 has been error corrected by the errorcorrection circuit 509. If a multi-bit error has been detected, the Cbit 512 is reset to indicate that the CAM word 510 has not been errorcorrected. In the embodiment of FIG. 16, the C bit 512 is loaded intothe error address register 517 along with the CAM word 510, the errorsignal 514 and the error address 536.

Still referring to FIG. 16, the error bit and error address in the headentry of the error address register 517 are used to produce the erroraddress 531 and error flag signal 532. These signals may be used tosupport background error checking and self-invalidation operations asdescribed above. The storage of the corrected CAM words 510 and C bits512 further enables a CAM device to perform a self-correction operationin which a corrupted CAM word within the CAM array is overwritten with acorrected CAM word from the error address register 517. Morespecifically, a write data multiplexer 540 is provided to select, inresponse to a path select signal 541 from the instruction decoder,either host-supplied data or a corrected CAM word from the error addressregister to be supplied to the write circuit. Also, the C bit at thehead entry of the error address register 517 is provided to theinstruction decoder to notify the instruction decoder that a correctedCAM word is available for use in a self-correction operation. In aself-correction operation, the write data multiplexer 540 outputs acorrected CAM word to the write circuit and the error address 531 issupplied to the address selector (not shown) to address the appropriateentry within the CAM array.

FIG. 18 illustrates the operation of an instruction decoder in aself-correction operation. As with the self-invalidation operation, theinstruction decoder monitors incoming host instructions in decisionblock 570 to determine whether a no-op instruction is received or if anyidle intervals occur. If instructions requiring read, write or compareoperations on the CAM array are received, the instructions are executedas indicated by block 572. If a no-op instruction (or idle interval) isdetected at decision block 570, the instruction decoder evaluates theerror flag signal at block 574 to determine if the error detector hasdetected an error in the CAM array. If the error flag is not set, theinstruction decoder returns to decision block 570 to monitor theincoming instructions for no-ops and idle intervals. If the error flagis set, then at block 576 the instruction decoder signals the addressselector to select the error address output by the error addressregister as the address source for a CAM array access. If theinstruction decoder determines the C bit to be set at decision block578, the instruction decoder signals the write data multiplexer at block580 to select the error address register to supply a corrected CAM wordfor a write operation. Subsequently, at block 582, the instructiondecoder signals the write circuit to write the corrected CAM word to theCAM array at the error address. Finally, at block 584, the instructiondecoder signals the error address register to advance to the next entry.Returning to decision block 578, if the C bit is not set, theinstruction decoder may perform a self-invalidate operation prior tosignaling the error address register to advance. For example, as shownin block 586, the instruction decoder may signal the write circuit toclear the validity bit for the CAM word indicated by the error address,thereby invalidating the CAM word within the CAM array.

As with the self-invalidation operation, it may be desirable for theinstruction decoder to issue a busy signal to the host processor duringa self-correction operation to prevent the host processor from issuinginstructions that may result in a resource conflict within the CAM array(e.g., host instructions that require read, write or compare operationsto be performed on the CAM array). This signal is indicated by dashedline 447 in FIG. 14. Also, as with the self-invalidation operation, theself-correction operation may be aborted to avoid delaying execution ofhost instructions. Further, it may be desirable to provide an alternateerror storage as described above so that, as the CAM device performsself-correction and self-invalidation operations to clear errors in theerror address register, those same errors remain logged in the alternateerror storage. The host may then access the alternate error storage fromtime to time to determine whether errors have occurred and, if so, takeappropriate actions to maintain coherency between the CAM array and thebackup storage, and restore any invalidated CAM words.

Generating a Sequence of Error Check Addresses

FIG. 19 illustrates the increment operation within an address generatorused to generate a sequence of error check addresses including, withoutlimitation, the parity addresses and ECC addresses described above. Inone embodiment, the error check address is formed by three addresscomponents: a block address, a segment address, and a row address. Theblock address is used to select one of a plurality of storage blocks,the segment address is used to select one of a plurality of segmentswithin the selected storage block and the row address is used to select,within the selected segment, the row containing the CAM word (or partialCAM word) to be error checked. The block address component of the errorcheck address may be omitted in a CAM device that includes only a singlestorage block, and the segment address component may likewise be omittedin a CAM device that has only one segment per storage block.

For the purpose of the present description, the address generator isassumed to be implemented in a CAM device having K storage blocks, eachcontaining Z segments that are Y rows deep. Thus, the block addressranges from 0 to K−1, the segment address ranges from 0 to Z−1 and therow address ranges from 0 to Y−1.

Referring now to decision block 601, if an increment signal is detected,the row address (RA) of the error check address is evaluated in decisionblock 603 to determine if the row address has reached the row limit(i.e., the final row address, Y−1). This may be accomplished, forexample, by a comparison of the row address and row limit in acomparator. Other techniques and circuits may also be used to detectwhen the row limit has been reached.

If the row address has not reached the row limit, the row address isincremented by one in block 605 to complete the increment operation. Ifthe row address has reached the row limit, the row address is reset tozero in block 607, followed by evaluation of the segment address (SA) indecision block 609 to determine if the segment address has reached thesegment limit (i.e., Z−1). If the segment address has not reached thesegment limit, the segment address is incremented by one in block 611 tocomplete the increment operation. If the segment address has reached thesegment limit, the segment address is reset to zero in block 613,followed by evaluation of the block address (BA) in decision block 615to determine if the block address has reached the block limit (i.e.,K−1). If the block address has not reached the block limit, the blockaddress is incremented by one in block 617 to complete the incrementoperation. If the block address has reached the block limit, the blockaddress is reset to zero in block 619 to complete the incrementoperation.

The increment operation may be changed in numerous ways in alternativeembodiments. For example, in the increment operation described above,the row address is effectively treated as the least significantcomponent of the error check address, followed by the segment addressand then the block address. Any order of significance may be assigned tothe row, segment and block addresses in alternative embodiments. Forexample, the block address may be incremented from 0 to K−1 beforeeither the segment or row addresses are incremented, or the segmentaddress may be incremented from 0 to Z−1 before either the block or rowaddresses are incremented.

In another implementation of the increment operation, one or more of thecomponents of the error check address may be incremented by values otherthan one. For example, assuming Y is even, the row address component maybe incremented by any odd value with modulo Y arithmetic being used tocalculate the result (the decision block 603 of FIG. 19 may be modified,for example, to test for RA=Y−1−i, where i is the increment value).Also, the increment may be negative instead of positive such that theaddress components are counted down instead of up. Finally, theincrement operation described in reference to FIG. 19 is used toseparately address each row of each segment of each block. Inalternative embodiments, the each segment of a given block may beaccessed together to concurrently error check all the segments for agiven row address component; or each segment within each of the blocksmay be accessed together to concurrently error check the same row acrossall segments and all blocks. In yet another embodiment, the segmentaddress may be incremented by a selectable amount according to theconfiguration of the corresponding storage block. For example, if thestorage block is configured for a ×2 CAM word, the segment address maybe incremented by two instead of one in block 611 of FIG. 19.

Embodiment without Validity Bits

Each of the CAM device embodiments described thus far have includedvalidity bits to indicate whether corresponding CAM words are valid andto gate the error flag signal accordingly. In alternative embodimentsthe validity bit storage may be omitted from the CAM device and thegating circuitry (e.g., element 222 of FIGS. 6 and 7, element 398 ofFIG. 12, element 407 of FIG. 13, and element 513 of FIG. 16) omittedfrom the error detector. In one embodiment, for example, each of therows of CAM cells may initially be filled with a default value (e.g.,all ‘0’s) and the parity bit (or bits) or other error check values forthe row set accordingly. By this arrangement, all CAM words in the CAMarray are effectively ‘valid’ in that known values together withappropriate error checking values have been stored in each of the rowsof CAM cells. Accordingly, the error checking embodiments describedherein may be modified by removing the validity-based gating circuitry(e.g., element 222 of FIGS. 6 and 7, element 398 of FIG. 12, element 407of FIG. 13, and element 513 of FIG. 16), and then using the remainingcircuitry to detect and log errors, and to perform self-correctionoperations. Self-invalidation operations may effectively be performed byresetting a corrupted CAM word to the default value.

System Structure and Operation

FIG. 20 illustrates a system device 651 that includes a host processor650 (e.g., general purpose processor, digital signal processor, networkprocessor, ASIC, etc.) and a CAM device 655 according to one of theembodiments described herein. The system device may be, for example, anetwork switch or router, or any other type of device in which the fastcompare capability of the CAM device 655 may be useful.

The host processor 650 issues addresses, comparands, and instructions tothe CAM device 655 via the address, comparand and instruction buses,respectively (i.e., ABUS 141, CBUS 143 and IBUS 145), and receives CAMindices and status information from the CAM device 655 via an addressand status bus 149 (ADS). Though not shown in FIG. 20, the address andstatus bus 149 may additionally be coupled to supply CAM indices to anassociated storage. The CAM indices may alternatively (or additionally)be output to the host processor 650 and/or the associated storage via adedicated signaling path. Also, in alternative embodiments, one or moreof the buses (e.g., ABUS, CBUS, IBUS, ADS) may be omitted and thecorresponding information time multiplexed onto another of the buses.Further, the CAM device 655 and host processor 650 may be implemented indistinct integrated circuits (ICs) and packaged in distinct IC packages,or in a single IC (e.g., in an ASIC, system-on-chip, etc.), or in an ICpackage that includes multiple ICs (e.g., a multi-chip package, paperthin package, etc.).

Still referring to FIG. 20, the error flag signal 132 is preferablyoutput from the CAM device 655 to the host processor 650 via a dedicatedsignal path (EFLAG), while the error address value 131 is preferablyoutput from the CAM device 655 to the host processor 650 via the addressand status bus 149. Alternatively, the error address 131 may be outputto the host processor via a dedicated path as shown by the dashed linelabeled ERROR ADDR in FIG. 20. Also, as discussed above, the error flagsignal may alternatively (or additionally) be output to the hostprocessor via the address and status bus 149. Further, a busy signal 447may be output from the CAM device 655 to the host processor 650 tosignal the host processor 650 that the CAM device 655 is busy performinga self-invalidation operation or self-correction operation as describedabove.

The host processor 650 is also coupled to a backup storage 657 which isused to store a backup copy of the CAM words stored in the CAM device655. The backup storage 657 is preferably a non-volatile storage such asa battery-backed semiconductor storage, an electrically programmableread only memory (EPROM), a flash EPROM, or a magnetic or opticalmedium, but any type of data storage device may be used in alternativeembodiments.

FIG. 21 illustrates the operation of the host processor of FIG. 20according to one embodiment. Initially, at decision block 680, the hostprocessor samples the error flag signal to determine whether the CAMdevice has detected an error in a CAM word. Sampling the error flagsignal may involve, for example, sensing the error flag signal at adedicated receiver of the host processor or issuing an instruction tothe CAM device to output the error flag signal onto the address andstatus bus (or other signal line). If the error flag is not set, thehost processor executes the next scheduled instruction, if any, in block682. If the error flag is set, the host processor issues a instructionto the CAM device to output the error address (e.g., an “EA READ”instruction) in block 684. Some time later, at block 686, the hostprocessor receives the error address from the CAM device, for example,via the address and status bus. At block 688, the host processor usesthe error address to index (i.e., address) a backup storage device toretrieve backup data. After the backup data has been retrieved, the hostprocessor issues an instruction to the CAM device at block 690 to writethe backup data to the CAM array at the error address, thus overwritingthe corrupted CAM word with an error free value.

Match Error Signaling

FIG. 23 illustrates the use of CAM device 100 of FIG. 1 in an exemplarynetwork switching or routing application. As shown, packet traffic flowsthrough a network processing unit (NPU) 703 which issues read, write andcompare instructions to the CAM device 100. For example, the NPU 703 mayoutput a comparand to the CAM device 100 in the form of selected fieldsof an incoming packet, and instruct the CAM device 100 to perform acompare operation. The CAM device 100 responds by comparing thecomparand to CAM words stored within the CAM array and outputting amatch index and match flag (or flags) according to the comparisonresult.

Although the NPU 703 may act as a host processor (e.g., as described inreference to FIGS. 20 and 21), a central processing unit (CPU) 701 isoften provided to perform some or all of the host processor actionsdescribed herein. For example, the CPU 701 may monitor an error flagsignal from the CAM device 100 and take corrective action when an erroris detected in a CAM word stored within the CAM device 100 (e.g.,overwrite the corrupted CAM word with a data word from a backupstorage). Depending upon the speed with which the CPU 701 responds to anerror indication, the NPU 703 may request the CAM device 100 to performany number of compare operations before the CPU 701 takes correctiveaction. If, during a given compare operation, a highest priority matchis detected between a comparand value and a corrupted CAM word, theresulting match index may be invalid (i.e., if the defective bits withinthe corrupted CAM word are not masked in the compare operation, thematch index will have resulted from a false match and therefore will beinvalid). Accordingly, any match index generated between the time anerror is detected within the CAM device 100 and the time the CPU 701 orother device takes corrective action may be invalid and may thereforeresult in incorrect routing or classification of the correspondingpacket.

FIG. 24 illustrates a match error detector 705 that may be includedwithin the CAM device 100 of FIG. 1 (or CAM device 441 of FIG. 14) togenerate a match error signal 732. The match error signal 732, whenasserted, indicates that a match index 174 generated during a compareoperation has resulted from a match with a corrupted CAM word. An NPU orother device receiving the match index 174 may also receive the matcherror signal 732 and therefore decide, according to the state of thematch error signal 732, whether to perform a given processing operation(e.g., forwarding or classification) on the corresponding packet. Therecipient of an asserted match error signal 732 may also take otheraction, such as notifying another processor of the error condition,notifying another network node (e.g., router, switch, etc.) of the errorcondition so that the network node may take remedial action (e.g.,rerouting network traffic), saving the processing operation that yieldedthe match error signal 732 for later retry, and so forth.

Still referring to FIG. 24, the match error detector 705 receives anN-bit match index 174(0)-174(N−1) from a priority encoder 114, and anN-bit error address 131(0)-131(N−1) and error flag signal 132 from anerror detector 107. The error address 131 and error flag signal 132 maybe generated, for example, as described above in reference to FIG. 6.Match error detector 705 is a compare circuit that compares bits of theerror address 131 with corresponding bits of the N-bit match index 174to generate a match error signal 732. For example, as shown in FIG. 27,a set of N exclusive NOR gates 706 within the match error detector 705compare respective bits of the match index 174(0)-174(N−1) withcorresponding bits of the error address 131(0)-131(N−1) and outputrespective result signals to a logic AND gate 707. The logic AND gate707 also receives the error flag signal 132 from the error detector 107.Each of the logic NOR gates 706 outputs a logic high result signal ifthe input error address bit and match index bit match (i.e., are in thesame logic state), and a logic low result signal if the bits do notmatch. According, if the error flag signal 132 is asserted (indicatingthat the error address is valid), and the match index 174 matches theerror address 131 bit-for-bit, then logic AND gate 707 will assert thematch error signal 732 to indicate that the match index has resultedfrom a match with a corrupted CAM word. If the error flag signal 132 isdeasserted (indicating that the error address is not valid) or if anybit (or bits) of the match index 174 does not match the correspondingbit of the error address 131, then the logic AND gate 707 will deassertthe match error signal 732. In this way, a NPU or other processor mayreceive, for each match index 174 generated between the time a corruptedCAM word is detected within the CAM device and the time that correctiveaction is taken, an indication of whether the match index 174 hasresulted from a match with the corrupted CAM word. Thus, if a processorreceives a match index 174 together with an asserted match error signal732, the processor may be programmed not to forward or classify thecorresponding packet based on the match index, thereby avoidingincorrectly routing or classifying the packet.

FIG. 25 illustrates a CAM device 700 according to an embodiment thatincludes an error CAM 715 to assert a match error signal 732 if a matchindex 174 matches any of a plurality of error addresses. In addition tothe error CAM 715, the CAM device 700 includes a CAM array 101(optionally including validity bits 102), address circuit 103,instruction decoder 105, flag circuit 112, priority encoder 114,comparand register 115, read/write circuit 161 and error detectioncircuit 711. The CAM device 700 also includes interfaces to receive aninstruction bus 145, address bus 141, comparand bus 143 and a clock line(providing clock signal 104) as described in reference to FIG. 1.Further, the instruction decoder 105, address circuit 103, CAM array101, comparand register 115, read/write circuit 161, flag circuit 112and priority encoder 114 are coupled to one another and operategenerally as described in reference to FIGS. 1-5. That is, theinstruction decoder 105 issues enable and select signals (126 and 118)to the address circuit 103 to control the generation of a sequence ofcheck addresses 155. For each check address 155 in the sequence, theaddress circuit 103 activates a corresponding one of a plurality of wordlines 181 to enable a selected CAM word to be read from the CAM array101 by the read/write circuit 161. An error detection circuit 711, whichmay be implemented, for example, by the parity check circuit 201 andlogic gate 222 described above in reference to FIG. 6 (or any of theother error detection embodiments described above), is coupled toreceive the selected CAM word from the read/write circuit 161 and tooutput an error signal 712 to the error CAM 715. The error detectioncircuit 711 asserts the error signal 712 upon detecting an error in theselected CAM word and deasserts the error signal 712 if no error isdetected.

In one embodiment, the error CAM 715 includes an error CAM array and aqueue control circuit that establishes a first-in-first-out (FIFO)protocol for storing error address values (i.e., check addresses 155)within the error CAM array. That is, the queue control circuit forms aqueue of storage locations within the error CAM array, and, in oneembodiment, includes a read pointer that points to the least recentlystored (i.e., oldest) error address value within the queue (the head ofthe queue), and a write pointer that points to the most recently storederror address value within the queue (the tail of the queue). If theerror signal 712 is asserted, the error CAM 715 advances the writepointer to point to a next available storage location, the new queuetail, then loads the check address 155 for the selected CAM word (i.e.,the CAM word determined to have an error) into a storage locationindicated by the write pointer (alternatively, the check address may beloaded prior to advancing the write pointer). If an advance signal 708is asserted by the instruction decoder 105, the error CAM 715 clears avalidity value stored in the queue head location, thereby releasing theoldest error address value from the queue, then advances the readpointer to establish a storage location containing the next leastrecently stored error address value as the new head of the queue. In oneembodiment, the error address at the queue head is output from the errorCAM 715 via a dedicated read port to provide the error address signal131. As with embodiments discussed above, the error address signal 131may be output from the CAM device 700 via a dedicated interface, via amultiplexed interface (e.g., to a status bus), via a status word, andvia any other output node of the CAM device. As shown in FIG. 25, theerror CAM 715 may receive a reset signal 153 to reset the error CAM 715during initialization of CAM device 700.

As discussed above, the error checking engine implemented by the checkaddress generator (i.e., within address circuit 103), read/write circuit161 and error detection circuit 711 may operate in the background ascompare operations are performed within the CAM device 700. That is,concurrently with checking a selected CAM word for error, a comparandvalue received via the CBUS 143 (and optionally stored in the comparandregister 115) may be compared with the contents of the CAM array 101 todetermine whether the comparand value matches any valid CAM words storedwithin the CAM array 101. A plurality of match lines 182, coupled torespective rows of CAM cells within the array 101 (as described inreference to FIG. 5), are provided to deliver match signals to the flagcircuit 112 and the priority encoder 114, each match signal indicatingwhether a CAM word stored within a respective row of CAM cells matchesthe comparand value. If any of the match signals is asserted, therebyindicating a match, the flag circuit 112 outputs a match flag signal 176(and, optionally, a multiple match flag signal if more than one of thematch signals is asserted), and the priority encoder 114 outputs a matchindex 174 that corresponds to the highest priority row of CAM cellscontaining a CAM word that matches the comparand value.

The match index 174, in addition to being output from the CAM device700, is input to the error CAM 715 for comparison with error addressvalues queued therein. If the match index 174 matches any of the erroraddress values, the match error signal 732 is asserted to indicate thatthe match index corresponds to a corrupted CAM word within the CAM array101. The match error signal 732 may then be used by the recipient device(e.g., NPU, CPU, etc.) as discussed above in reference to FIG. 24 tomake packet processing decisions.

It should be noted that the multiple-entry error address register 289 ofFIG. 7 may be used to implement CAM array 715 in one embodiment, witheach error address entry within the multiple-entry error addressregister being formed by a respective row of CAM cells. FIG. 26illustrates an alternative embodiment of a CAM device 750 that includesan error CAM. The CAM device 750 includes a CAM array 101, addresscircuit 103, instruction decoder 105, flag circuit 112, priority encoder114, comparand register 115, read/write circuit 161 and error detectioncircuit 711, each coupled as described in reference to FIG. 25 (e.g.,via internal signals 118, 126, 181, 182, and to buses 141, 143 and 145),and each cooperating as described in reference to FIG. 25 to generate amatch flag signal (or signals) 176, a match index 174 and an errorsignal 712.

The CAM device 750 differs from the CAM device 700 of FIG. 25 in thatthe error logging and match error detection functions are split betweenan error log circuit 731 and an error CAM 751, respectively, rather thanbeing performed within a single error CAM circuit. The error log circuit731 may include, for example, the error address register 203 and SIRflip-flop 224 described in reference to FIG. 6, or the multiple-entryerror address register 289 of FIG. 7, or any other circuits for storingerror addresses and outputting the error address signal 131 and errorflag signal 132. The error CAM 751 includes circuitry to compare thematch index 174 to error address values stored within the error CAM 751and to output a match error signal 732 if the index matches any of theerror address values. The error CAM 751 may be implemented in the samemanner as error CAM 715 of FIG. 25 , except that the dedicated read portfor outputting the error address 131 may be omitted. The reset signal153 may be used to reset both the error log 731 and the error CAM 751during device initialization. Also, the advance signal 735 may be usedto advance the queue head within the error CAM 715 as discussed inreference to FIG. 25.

FIG. 27 illustrates an embodiment of the error CAM 715 of FIG. 25 ingreater detail. The error CAM 715 includes an error CAM array 800,read/write circuit 803, queue control circuit 807, and match logiccircuit 831. The CAM array 800, is organized in rows and columns of CAMcells with each row of CAM cells including a number of storage CAM cells801 and a validity CAM cell 802. Within a given row, the storage CAMcells 801 are used to store an error address value, while the validityCAM cell 802 is used to store a validity value that indicates whether avalid error address value is stored within the corresponding storage CAMcells 801. In one embodiment, each storage CAM cell 801 includes amemory element to store a single bit of an error address value, and eachrow of CAM cells includes a sufficient number of storage CAM cells 801to store an N-bit error address value, where N is at least log₂R (Rbeing the number of independently addressable storage locations in theCAM array 101 of FIG. 1 so that log₂R is the size, in bits, of an erroraddress value that decodes to a unique row or row segment within thedata CAM array 101 of FIGS. 25 and 26). In alternate embodiments, moreor fewer storage CAM cells 801 may be included in each row of CAM cellswithin the error CAM array 800. For example, in a CAM device that may becoupled to additional CAM devices in a cascade arrangement (effectivelymultiplying the size of the data CAM array 101 of FIGS. 25 and 26 by thenumber of cascaded devices), additional storage CAM cells 801 may beincluded within each row of the error CAM array 800 to uniquely identifyone of the cascaded CAM devices.

Still referring to FIG. 27, each row of CAM cells within error CAM array800 is coupled to the queue control circuit 807 via a respective readword line 823 and write word line 825, and to the match logic circuit831 via a respective match line 827. Each column of CAM cells, includingthe column of validity CAM cells 802, is coupled to a pair of comparandlines, CL and {overscore (CL)}, to receive a comparand bit and itscomplement; to a pair of write bit lines, WBL and {overscore (WBL)}, toreceive an error address value during a load operation; and to a pair ofread bit lines, RBL and {overscore (RBL)}. In one embodiment, the readbit lines coupled to the columns of storage CAM cells form a read portfor outputting the error address signal (i.e., signal 131 of FIG. 25).The read bit lines coupled to the column of validity CAM cells 802 mayalso be used to read out the validity value(s) stored therein. The readbit lines (or the write bit lines) coupled to the column of validity CAMcells 802 may also be used during or after a queue advance operation toclear the validity value stored within the storage location at the headof the queue. For example, after the error address stored in a row ofCAM cells 801 is read, the error address may be used to select thevalidity CAM cell 802 of the same row (either in the same or asubsequent clock cycle) and the validity value overwritten via the reador write bit lines to an invalid state. Alternatively, while the row ofCAM cells 801 is selected for reading (e.g., via the read word lineRWL), the corresponding validity CAM cell 802 of the same row may beselected (e.g., by the RWL or WWL), and may be written (simultaneouslyor sequentially) to an invalid state over the read or write bit lines.The component bits of the match index 174 constitute the comparand bitssupplied to the CAM cells 801 during a compare operation, whilededicated logic high and logic low inputs (shown, for example, as supplyvoltage and ground reference connections, respectively, in FIG. 27) formthe comparand value provided to the validity CAM cells 802. Inalternative embodiments, the signals provided to the validity CAM cells802 via the comparand signal lines may be programmable rather than thepair of fixed-level signals shown in FIG. 27.

The read/write circuit 803 is used in conjunction with the queue controlcircuit 807 to store error address values in the CAM array 800. Asdiscussed above, in one embodiment, the queue control circuit 807includes read and write pointers that enable the error CAM array 800 tobe operated as a queue. The write pointer points to a row of CAM cellsthat constitute a tail storage location of the queue, and the readpointer points to a row of CAM cells that constitute a head storagelocation of the queue. Error address values are loaded into the queue atthe tail storage location, and read out of the queue at the head storagelocation. More specifically, when an error signal 712 is detected at aload input of the queue control circuit 807, the queue control circuit807 increments the write pointer to point to an available row of CAMcells within the error CAM array 800, then activates a word line 825indicated by the write pointer to select (i.e., enable) the row of CAMcells to receive an error address via the write bit lines, WBL and{overscore (WBL)}. The read/write circuit 803 receives an error addressvalue from the address circuit (e.g., element 103 of FIGS. 25 and 26) inthe form of a check address 155 and drives the constituent bits of theerror address value onto respective pairs of write bit lines for storagewithin the selected row of storage CAM cells 801. Also, the read/writecircuit 803 drives a validity value onto the write bit lines coupled tothe column of validity CAM cells 802 so that the validity CAM cell 802corresponding to the selected row of storage CAM cells 801 will store avalid indication for the newly stored error address value.

In one embodiment, the read pointer is used to select the row of CAMcells coupled to the read port formed by the read bit lines, RBL and{overscore (RBL)}. More specifically, the read pointer is decoded toactivate a read word line 823 coupled to the row of CAM cells at thehead of the queue, thereby enabling the error address at the head of thequeue to be output via the read bit lines as the error address signal131. When an advance signal 735 is asserted, the read/write circuit 803drives an invalidity value onto the read bit lines coupled to the columnof validity CAM cells 802 to clear the validity indication for the erroraddress at the head of the queue. After the validity value at the headof the queue is cleared, the queue control circuit increments the readpointer to establish a new storage location as the head of the queue.

CAM cells 801 may be any type of CAM cell including, without limitation,binary, ternary, NAND, NOR, volatile or nonvolatile. Additionally, asingle read bit line may be used instead of the pair of read bit lines(RBL and {overscore (RBL)}), a single write bit line may be used insteadof the pair of write bit lines (WBL and {overscore (WBL)}), and/or asingle comparand line may be used instead of the pair of comparand lines(CL and {overscore (CL)}). Further, instead of providing separate theread bit lines, write bit lines, and comparand lines, only one or twosignal lines (or signal line pairs) may be provided in alternativeembodiments with the signals for the omitted bit lines and/or comparandlines multiplexed onto the provided signal lines.

The reset signal 153 is input to the queue control circuit 807 and tothe column of validity CAM cells 802. When the reset signal 153 isasserted, the read and write pointers within the queue control circuitare reset to an initial state, and the validity value within each of thevalidity CAM cells 802 is cleared.

When a match index 174 is received within the error CAM array 800 (i.e.,via the comparand signal lines), the match index is simultaneouslycompared with each error address value stored within the CAM array 800.In the embodiment of FIG. 27, if a bit of the error address value storedwithin a given CAM cell 801 does not match the corresponding bit of thematch index, a compare circuit within the CAM cell 801 will force thematch line 827 to signal a mismatch condition. Similarly, if the valuestored within a given validity CAM cell 802 indicates that thecorresponding CAM cells 801 do not contain a valid error address value,the validity CAM cell 802 will force the match line 827 to signal amismatch condition. If a valid error address value stored within a givenrow of CAM cells matches the match index, then the corresponding matchline 827 will signal a match condition. In the embodiment of FIG. 26,the match signal present on a given match line effectively represents awired NOR of mismatch signals output by the individual CAM cells 801coupled to the match line. That is, the active low mismatch indicationsfrom each of the CAM cells 801 are effectively ORed with one another toproduce an active high match signal on the corresponding match line 827.In an alternate embodiment, the match signals output by each of the CAMcells 801 in a given row may be logically combined in a logic gate(e.g., an AND, OR, NAND or NOR logic gate) with an output of the logicgate being used to set the signal level on match line 827. Moregenerally, any circuit for generating a signal indicative of whether anerror address value stored within a row of CAM cells matches the matchindex 174 may be used without departing from the spirit and scope of thepresent invention.

In one embodiment, the match logic circuit 831 is implemented by an ORlogic circuit so that, if a match signal is asserted to a high logicstate (i.e., has a logical state indicative of a match condition) on anyof the match lines 827, the match logic circuit 831 will assert thematch error signal 732. Other logic circuits may be used to implementthe match logic circuit 831 in alternative embodiments.

FIG. 28 illustrates the queue control circuit 807 of FIG. 27 accordingto one embodiment. The queue control circuit 807 includes a writepointer 861, write address decoder 862, read pointer 863, read addressdecoder 864, and flag logic circuit 865. In the embodiment of FIG. 28,the read and write pointers 861, 863 are each implemented by an upcounter having a strobe input (UP), a reset input (RST) and a countoutput (CNT). A count value maintained within each counter 861, 863 isincremented by one in response to a rising edge at the strobe input,reset to a start count in response to a high logic level signal at thereset input, and output as a binary-encoded set of bits at the countoutput. In one embodiment, each of the counters 861, 863 is a modulo Mcounter that counts up from zero to M−1, then rolls back to zero.Counter 863 is reset to zero and counter 861 is reset to M−1 (andtherefore will roll to 0 during the first load operation following areset) when the reset signal 153 is asserted. In an alternateembodiment, the counters 861 and 863 may default to any value (includingdifferent values from one another) upon assertion of reset signal 153,and may count down instead of up. Also, instead of incrementing by onein response to a rising edge signal at the strobe input, the countersmay be incremented by any value, positive or negative.

A queue load operation is initiated when a full signal 855 is deassertedby the flag logic circuit 865 and a load signal 712 (i.e., error signal712 of FIGS. 25, 26 and 27) is asserted. More specifically, logic ANDgate 851 responds to the assertion of the load signal 712 and thedeassertion of the full signal 855 by passing a rising edge of clocksignal 804 to the strobe input of the write pointer 861 (i.e., as writestrobe signal 852), thereby incrementing the count value within thewrite pointer 861. Note that clock signal 804 may be the clock signal104 discussed above, a clock signal derived from clock 104, or anotherclock signal or control signal.

The count value maintained within the write pointer 861 constitutes aqueue tail address and is output to the write address decoder 862. Inone embodiment, the write address decoder 862 is a log₂M to M decoderwhich asserts one of M write enable signals 869 according to the queuetail address (M being the number of independently addressable rows ofCAM cells within the error CAM array). The M write enable signals areinput, respectively, to a set of M logic AND gates 873 which are used todrive the write word lines 825. Each of the logic AND gates 873 alsoreceives the load signal 712 and an inverted version of clock signal 804via inverter 871. Accordingly, at a falling edge of the clock signal804, and while the load signal 712 is asserted, the asserted one of thewrite enable signals 869 enables a corresponding one of the logic ANDgates 873 to activate the write word line that corresponds to theincremented queue tail address. In one embodiment, the load signalremains asserted long enough for the read/write circuit 803 (describedabove in reference to FIG. 27) to write an error address value andvalidity value into the row of CAM cells selected by the activated writeword line.

The count value maintained within the read pointer 863 constitutes aqueue head address and is output to the read address decoder 864. In oneembodiment, the read address decoder 864 is also a log₂M to M decoderwhich activates a selected one of M read word lines 823 according to thequeue head address. Unlike write word lines which are activated onlyduring load operations, the selected read word line 823 remainsactivated until an advance operation is performed to increment the readword line selection. By this arrangement, the error address storedwithin the row of CAM cells coupled to the selected read word line isoutput as an error address signal via the read port formed by the readbit lines, RBL and {overscore (RBL)}, described in reference to FIG. 27.

Reflecting upon the operation of the write pointer and write addressdecoder, it will be appreciated that, prior to initiation of a loadoperation, the write pointer points to a row of CAM cells containing themost recently stored error address value. During a load operation, thewrite pointer is first incremented to point to an available storagelocation (effectively advancing the queue tail), then an error addressvalue is loaded into the storage location. This order of operation maybe reversed in alternative embodiments by first loading an error addressvalue into an available storage location, then incrementing the writepointer to point to a next available storage location. In such anembodiment (which may be achieved, for example, by removing inverter 871and inverting the clock signal at the input to logic AND gate 851), thewrite pointer 861 may be reset to the same initial value as the readpointer 863 in response to the reset signal 153.

A queue advance operation is initiated when an empty signal 857 isdeasserted by the flag logic circuit 865 and the advance signal 735 isasserted. More specifically, logic AND gate 853 responds to assertion ofthe advance signal 735 and deassertion of the empty signal 857 bypassing a rising edge of clock signal 804 to the strobe input of theread pointer 863 (i.e., as read strobe signal 854), thereby incrementingthe queue head address.

Reflecting on the operation of the queue control circuit 807, it can beseen that, at any given time, the read and write pointers 861 and 863define which rows of CAM cells within the error CAM array (e.g., element800 of FIG. 27) are included within the queue. Accordingly, in analternative embodiment, the validity CAM cells 802 and associated signallines may be omitted from the CAM array 800 of FIG. 27 and the read andwrite pointers may be used to disable match indications for those rowsof CAM cells not included within the queue.

FIG. 29 illustrates an embodiment of the flag logic circuit 865 of FIG.28. The flag logic circuit 865 includes a counter 891 that maintains aqueue depth count, and compare circuits 892, 894 and 896 to determinewhen the queue depth count is at a maximum (M), near maximum (greaterthan K), and zero, respectively. Logic AND gates 893 and 895 areprovided to generate conditioned read and write strobe signals 866 and867, respectively. More specifically, logic AND gate 893 receives thewrite strobe signal 852 at a non-inverting input, and receives the readstrobe signal at an inverting input. By this arrangement, a rising edgeof the write strobe signal 852 is passed through the logic AND gate 893except when the read strobe signal 854 is high. Similarly, logic ANDgate 895 receives the write strobe signal at an inverting input and theread strobe signal 854 at a non-inverting input so that a rising edge ofthe read strobe signal 854 passes through the logic AND gate 895 exceptwhen the write strobe signal 852 is high. By this arrangement, theconditioned read and write strobe signals 866, 867 correspond to theread and write strobe signals 852, 854, respectively, except that theconditioned read and write strobe signals 866, 867 are prevented frombeing in a logic high state (or transitioning to a logic high state) atthe same time. The counter 891 receives conditioned write and readstrobe signals 866, 867 at respective up and down count inputs, andincludes logic to increment the queue depth count by one in response tothe conditioned write strobe signal 866 and decrement the queue depthcount by one in response to the conditioned read strobe signal 867.Initially, and whenever the reset signal 153 is asserted, the queuedepth count is reset to zero, causing compare circuit 896 to assert theempty signal 857. Assertion of the empty signal 857 disables logic ANDgate 853 of FIG. 28 from asserting the read strobe signal 854.Accordingly, queue advance operations are blocked when the queue isempty. During a load operation, assertion of the write strobe signal 852causes the queue depth count to be incremented by one. Accordingly,after the first load operation, the queue depth count is no longer equalto zero so that the empty signal 857 is deasserted and queue advanceoperations are permitted. If the queue depth count reaches K+1, K beingan integer value between 0 and M, the almost full signal 859 is outputto indicate the near full condition of the error CAM array. In oneembodiment, the value of K (i.e., the warning value) may be maintainedin a register or other storage element within a CAM device and run-timeprogrammed by a host processor. In another embodiment, the warning valuemay be one-time programmable, for example, by blowing fuses or otherwiserecording a non-volatile value within the CAM device. Alternatively, thewarning value (K), may be set to reflect a half-full state, an almostempty state, or any other indication of the number of error addressvalues stored in the error CAM array. Also, any number of additionalwarning values and corresponding compare circuits 894 may be provided togenerate a plurality of queue status signals in alternative embodiments.If the queue depth count reaches M, then the queue is full (i.e., M moreload operations have been performed than advance operations), and thecomparator 892 asserts the full signal 855. Assertion of the full signal855 disables logic AND gate 851 of FIG. 28 from asserting the writestrobe signal 852, thereby preventing queue load operations.

The empty signal 857, full signal 855 and almost full signal 859 may beoutput to a processor (or other device) via a dedicated output interfaceor via a multiplexed interface. In another embodiment, the empty, full,and almost full signals are used to set corresponding bits within astatus word that may be read by a processor (or other device) in astatus read operation. Also, circuitry to generate the almost fullsignal may be omitted altogether.

By preventing the conditioned read and write strobe signals 866, 867from transitioning to a high logic state at the same time, the logic ANDgates 893, 895 prevent the queue depth count from being changed during aclock cycle in which both the write strobe signal 852 and the readstrobe signal 854 are asserted. Different types of circuits within (orexternal to) the counter 891 may be used for this purpose in alternativeembodiments. Also, the flag logic circuit 865 may be implementeddifferently in alternative embodiments. For example, rather thanmaintain a queue depth count, the flag logic 865 may compare the countoutputs of the write pointer 861 and the read pointer 863 to determinefull, almost full and empty conditions.

FIG. 30 illustrates the CAM cell 801 of FIG. 27 according to oneembodiment. The CAM cell 801 is a multi-ported CAM cell that includesstorage element 901, compare circuit 910 and switch circuits 906-909. Awrite port formed by write bit lines WBL and {overscore (WBL)} iscoupled to the storage element 901 via switch circuits 907 and 906,while a read port formed by read bits lines RBL and {overscore (RBL)} iscoupled to the storage element 901 via switch circuits 909 and 908. Whenwrite word line 825 is activated, switch circuits 906 and 907 areswitched on, enabling a data value present on the write bit lines to bestored within the storage element 901. Similarly, when the read wordline 823 is activated, switch circuits 908 and 909 are switched on,enabling the data value stored within storage element 901 to be outputonto the read bit lines. The compare circuit 910 is coupled to receivethe data value from the storage element 901, and is coupled to acomparand port formed by comparand signal lines CL and {overscore (CL)}.During a compare operation, the compare circuit receives a comparandvalue via the comparand port, and compares the comparand value to thestored data value. The compare circuit outputs a match signal to affecta logical state of the match line 827 according to the compare result.

FIG. 31 illustrates an embodiment of the multi-ported CAM cell 801 ofFIG. 30 in greater detail. As discussed above, the CAM cell 801 is amulti-ported CAM cell that includes storage elements 901, a comparecircuit 910. In the embodiment of FIG. 31, transistor switches 917-920,coupled as pass gates, are used to implement the switch circuits andpass gates 906-909, respectively, of FIG. 30. The storage element 901 isdepicted in FIG. 31 as being implemented by back-to-back coupledinverters, though different types of storage elements may be used inalternative embodiments including, without limitation, dynamic storageelements (typically implemented by a single transistor and chargestorage element), non-volatile storage elements or any other type ofstorage element that can be used to store digital data.

The storage element 901 is coupled to write bit lines WBL and {overscore(WBL)} via the pass gates 917 and 918 respectively. Gate terminals ofthe pass gates 917 and 918 are coupled to a write word line 825 so that,when the write world line 825 is activated, the complementary signalspresent on the write bit lines are applied to the storage element 901 tostore a data value therein. The storage element 901 is coupled to readbit lines RBL and {overscore (RBL)} via pass gates 919 and 920. Gateterminals of the pass gates 919 and 920 are coupled to a read word line823 so that, when the read word line 823 is activated, the data valuestored within storage element 901 is output as a complementary pair ofsignals on the read bit lines.

Still referring to FIG. 31, the compare circuit 910 includes transistors911, 912, 913 and 914. Transistors 911 and 912 are coupled in seriesbetween a match line 827 and a reference potential (ground in thisexample), with a gate terminal of transistor 911 being coupled toreceive the data value from storage element 901 and a gate terminal oftransistor 912 being coupled to receive a complemented comparand bitfrom comparand line {overscore (CL)}. Similarly, transistors 913 and 914are coupled in series between the match line 827 and the referencepotential, with a gate terminal of transistor 913 being coupled toreceive a complemented version of the data value stored in storageelement 901, and a gate terminal of transistor 914 being coupled toreceive an uncomplemented comparand bit from comparand line CL. By thisarrangement, if the comparand value and the stored data value do notmatch, the match line 827 will be pulled low through one of thetransistor pairs 911/912 or 913/914, thereby signaling the mismatchcondition. For example, if the comparand is high and the stored datavalue is low, then transistors 913 and 914 will be switched on to pullthe match line 827 low. Conversely, if the comparand is low and thestored data value is high, transistors 911 and 912 will be switched onto pull the match line 827 low. If the comparand and data value match,then neither transistor pair 911/912 nor 913/914 will be fully switchedon, thereby interrupting the path to the reference potential (so thatthe match line is not pulled low) to indicate the match condition. Itshould be noted that additional circuitry may be included within the CAMcell 801, including without limitation, timing control circuitryinterposed between the ground reference and source terminals oftransistors 912 and 914 of the compare circuit 910 to provide for timingcontrol over the comparison of the comparand value and stored datavalue. Further, although a specific compare circuit implementation hasbeen described in reference to FIG. 31, any other circuit that may beused to detect a match condition (or mismatch condition) may be used inalternative embodiments.

The validity CAM cell 802 of FIG. 27 may be implemented in a mannersimilar to the CAM cell 801 shown in FIG. 31, except that a reset lineis provided to clear the value stored in storage element 901. Moregenerally, any storage cell capable of storing a validity bit andaffecting a logical state of the match line 827 according to the valueof the validity bit may be used to implement the validity CAM cell 802.Also, it should be noted that the error CAM array 800 described inreference to FIG. 27 (including the queue control circuit 807 andstorage CAM cell 801 described in reference to FIGS. 28 and 30) may beused to implement the error CAM 751 of FIG. 26. In such animplementation, neither the read bit lines (RBL and {overscore (RBL)})nor the read word line 823 need be connected to the storage CAM cells801. Also, the CAM cell 801 may have one or two signal ports, instead ofthe three signal ports (read, write, comparand) shown in FIG. 31.

Referring briefly to FIG. 27, it should be noted that, because separateread bit lines (RBL and {overscore (RBL)}), write bit lines (WBL and{overscore (WBL)}) and comparand lines (CL and {overscore (CL)}) areprovided, a comparand may be compared with error values stored withinthe error CAM array 800 concurrently with output of the error addressvalue via the read port (i.e., read bit lines RBL and {overscore(RBL)}), and concurrently with storage of a new error address valuewithin the error CAM array 800. Because the data value stored within agiven row of CAM cells may have an unknown logic state during a writeoperation, it may be desirable to provide circuitry to prevent matchindication by a row of CAM cells being loaded with an error addressvalue.

FIG. 32 illustrates a match disable transistor 933 that may be coupledto each match line 827 within the error CAM array 800 of FIG. 27 toprevent a match signal from being asserted on the match line while acorresponding row of CAM cells 932 is being loaded with an error addressvalue. A drain terminal of the match disable transistor 933 is coupledto the match line 827, a source terminal of the match disable transistor933 is coupled to a reference potential (ground in this example), and agate terminal of the match disable transistor 933 is coupled to thewrite word line 825 for the corresponding row of CAM cells 932. During aload operation directed to the row of CAM cells 932, the correspondingwrite word line 825 will be asserted, thereby switching on match disabletransistor 933 and pulling the match line 827 low. Thus, the matchdisable transistor 933 prevents a match indication for the row of CAMcells 932 during the load operation.

FIG. 33 illustrates the use of a delay circuit 931 to synchronize theoutput of a match index 933 and a match error signal 732. The priorityencoder 114 outputs a match index 174 to the error CAM 715 and to thedelay circuit 931. The match index 174 is designated “INDEX-I” in FIG.33 to indicate that it is an intermediate index signal. The error CAM715 performs the comparison operation described above to determine ifthe match index 174 matches any error address values stored within theerror CAM array and outputs a match error signal 732 accordingly. Thedelay circuit 931 delays the output of the match index 933 (designated“INDEX-D” in FIG. 33 to indicate that the match index 933 is a delayedversion of the match index 174) such that the match index 933 and thematch error 732 are output concurrently (i.e., at least partlyoverlapping in time). In one embodiment, the delay circuit 931 isimplemented by one or more delay elements coupled in series to delay thematch index 174 by a predetermined time that corresponds to the timerequired for the error CAM 715 to generate the match error signal 732.In an alternative embodiment, the delay circuit 931 may be implementedby a register or other edge-triggered circuit that outputs the matchindex 933 in response to an output control signal (shown by dashed line789), supplied, for example by an instruction decoder (e.g., element 105of FIG. 24) or other circuit within the CAM device. The output controlsignal 789 may also be coupled to a register or other edge-triggeredcircuit within the error CAM 715 to time the output of the match errorsignal 732. By this arrangement the match index 933 and the match errorsignal 732 may be output in response to the same control signal and,therefore, at substantially the same time. Although error CAM 715 isdepicted in FIG. 33, the delay circuit 931 may also be used tosynchronize the match index signal 933 with the match index signal 732output by the error CAM 751 of FIG. 25.

FIG. 34 is a timing diagram that illustrates the pipelining of data anderror compare operations within a CAM device, and the relative outputtimes of an intermediate match index, delayed match index and matcherror signals (i.e., signals 174, 933 and 732, respectively, describedin reference to FIG. 33). During a first timing cycle, cycles (which maybe defined, for example, by one or more cycles of a clock signal, or apredetermined time interval), a corresponding data compare operation,data compare_(i), is performed. During the subsequent timing cycle,cycle_(i+1), the intermediate index signal, INDEX-I_(i), resulting fromdata compare_(i) is output and the corresponding error compareoperation, error compare_(i) is performed. Data compare_(i+1) is alsoperformed during cycle_(i+1). During cycle_(i+2), the delayed indexsignal, INDEX-D_(i), resulting from data compare_(i+1) is output, as isthe corresponding match error signal, ME_(i+1). Also during cycle_(i+2),data compare_(i+2) is performed, intermediate index signal INDEX-I_(i+1)is output and error compare_(i+1) is performed. Similarly, duringcycle_(i+3), the delayed index signal INDEX-D_(i+1), resulting from datacompare_(i+1) is output along with the corresponding match error signal,ME_(i+1), data compare_(i+3) is performed, intermediate index signalINDEX-I_(i+2) is output, and error compare_(i+2) is performed. Thus, itcan be seen that by pipelining the data compare and error compareoperations, an updated match index (INDEX-D) and corresponding errorsignal may be output during each new timing cycle, despite theadditional time required to perform the error compare operation.Accordingly, the overall throughput of the CAM device is not reduced.

Although the invention has been described with reference to specificexemplary embodiments thereof, it will be evident that variousmodifications and changes may be made thereto without departing from thebroader spirit and scope of the invention as set forth in the appendedclaims. The specification and drawings are, accordingly, to be regardedin an illustrative rather than a restrictive sense.

What is claimed is:
 1. A content addressable memory (CAM) devicecomprising: a first CAM array to store a plurality of data words; anerror detection circuit coupled to the first CAM array to check theplurality of data words for error and being adapted to assert an errorsignal upon detecting an error in one of the plurality of data words;and a second CAM array coupled to the error detection circuit and beingresponsive to the error signal to store an address of the one of theplurality of data words.
 2. The CAM device of claim 1 further comprisinga priority encoder coupled to the first CAM array via a plurality ofmatch lines and including logic circuitry to generate a match indexaccording to match signals asserted on the plurality of match lines, andwherein the second CAM array includes a plurality of comparand linescoupled to receive the match index from the priority encoder.
 3. The CAMdevice of claim 2 wherein the second CAM array includes comparecircuitry to compare the match index with the address of the one of theplurality of data words and to output a match error signal if the matchindex matches the address.
 4. The CAM device of claim 1 wherein theerror detection circuit comprises an address generator to generate asequence of addresses that correspond to the plurality of data wordschecked for error, the sequence of addresses including the address ofthe one of the plurality of data words.
 5. The CAM device of claim 4wherein the address generator is coupled to the second CAM array toprovide the address of the one of the plurality of data words thereto.6. The CAM device of claim 4 wherein the sequence of addresses includesa sequence of incrementally different addresses that correspond torespective rows of CAM cells within the first CAM array.
 7. The CAMdevice of claim 4 further comprising an address selector coupled to theaddress generator and coupled to at least one other address source, theaddress selector being responsive to a select signal to select eitherthe address generator or the at least one other address source to supplyan address for accessing the first CAM array.
 8. The CAM device of claim7 wherein the at least one other address source comprises an address busto receive an address from a source external to the CAM device.
 9. TheCAM device of claim 7 wherein the at least one other address sourcecomprises a register to store an address generated within the CAMdevice.
 10. The CAM device of claim 9 wherein the register is configuredto store an address of an unoccupied row of CAM cells within the firstCAM array.
 11. The CAM device of claim 9 wherein the register isconfigured to store an address generated during a compare operationwithin the CAM device.
 12. A method of operation within a contentaddressable memory (CAM) device, the method comprising: determiningwhether a selected data word stored within a first CAM array has anerror; and storing, within a second CAM array, an address value thatcorresponds to a storage location of the selected data word within thefirst CAM array if the data word has an error.
 13. The method of claim12 further comprising: comparing a comparand value with a plurality ofdata words, including the selected data word, stored within the firstCAM array to generate an index indicative of a location within the firstCAM array that contains a data word that matches the comparand value;and comparing the index with the address value stored within the secondCAM array to determine if the data word that matches the comparand valueis the selected data word.
 14. The method of claim 13 further comprisingasserting a match error signal if the data word that matches thecomparand value is the selected data word.
 15. The method of claim 14further comprising concurrently outputting the index and the match errorsignal from the CAM device.
 16. The method of claim 15 whereinconcurrently outputting the index and the match error signal from theCAM device comprises delaying for a predetermined time before outputtingthe index from the CAM device.
 17. The method of claim 12 whereindetermining whether the selected data word stored within the first CAMarray has an error comprises systematically checking data words storedwithin the first CAM array for error, including checking the selecteddata word for error.
 18. The method of claim 12 wherein systematicallychecking data words stored within the first CAM array for errorcomprises generating a sequence of addresses and checking data wordsstored at the sequence of addresses for error.
 19. The method of claim18 wherein generating a sequence of addresses comprises generating apredetermined sequence of addresses.
 20. The method of claim 19 whereingenerating a predetermined sequence of addresses comprises: generating afirst address of the predetermined sequence of addresses based on acount value; and incrementally adjusting the count value to generate asubsequent address of the predetermined sequence of addresses.
 21. Themethod of claim 12 wherein determining whether a selected data word hasan error comprises determining whether the selected data word has aparity error.
 22. The method of claim 21 wherein determining whether theselected data word has a parity error comprises: generating a parityvalue based on constituent bits of the selected data word; and comparingthe parity value with a previously generated parity value associatedwith the selected data word.
 23. The method of claim 22 wherein thepreviously generated parity value is stored in a row of CAM cells of thefirst CAM array along with the selected data word.
 24. A contentaddressable memory (CAM) device comprising: a first CAM array; a secondCAM array; means for determining whether a data word stored within thefirst CAM array has an error; and means for storing, within the secondCAM array, an address value that corresponds to a storage location ofthe data word within the first CAM array if the data word has an error.25. The CAM device of claim 24 further comprising: means for comparing acomparand value with a plurality of data words stored within the firstCAM array to generate an index indicative of a location within the firstCAM array that contains a data word that matches the comparand value,the plurality of data words including the selected data word; and meansfor comparing the index with the address value stored within the secondCAM array to determine if the data word that matches the comparand valueis the selected data word.
 26. The CAM device of claim 25 furthercomprising means for asserting a match error signal if the data wordthat matches the comparand value is the selected data word.
 27. The CAMdevice of claim 26 further comprising means for concurrently outputtingthe index and the match error signal from the CAM device.